def recursive_get(d, k):
    """
    Recursive function to retrieve values from nested dictionaries.
    """
    if len(k) == 1:
        return d[k[0]]
    else:
        return recursive_get(d[k[0]], k[1:])