def build_dict(key_list, value):
    """
    Build a hierarchical dictionary with a single element from the list of keys and a value.
    :param key_list: List of dictionary element keys.
    :param value: Key value.
    :return: dictionary
    """
    temp_dict = {}
    if key_list:
        key = key_list.pop()
        temp_dict[key] = build_dict(key_list, value)  # recursion
        return temp_dict
    else:
        return value