<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def set_path(dicts, keys, v):
 """ Helper function for modifying nested dictionaries :param dicts: dict: the given dictionary :param keys: list str: path to added value :param v: str: value to be added Example: {'a': {'b': {'c': ['d']}}} In case of duplicate paths, the additional value will be added to the leaf node rather than simply replace it: {'a': {'b': {'c': ['d', 'e']}}} """

    for key in keys[:-1]:
        dicts = dicts.setdefault(key, dict())
    dicts = dicts.setdefault(keys[-1], list())
    dicts.append(v)