from typing import Any
from typing import Dict


def path_to_dict(path: str, val: Any) -> Dict:
    """
    Convert a path 'a.b.c' and value val to a nested dictionary of form
    {'a': {'b': {'c': val}}}
    """
    d = val
    for k in reversed(path.split('.')):
        d = {k: d}
    return d