from typing import List
from typing import Tuple


def build(pairs: List[Tuple[tuple, object]]) -> dict:
    """
    Builds a tree out of key-value pairs consisting of full
    path to the value and the value itself
    """
    tree = {}

    def append(tree, path, value):
        if not path:
            return

        key, *tail = path

        if tail:
            tree[key] = tree.get(key, {})
            append(tree[key], tail, value)
        else:
            tree[key] = value

    for path, value in pairs:
        append(tree, path, value)

    return tree