Given a binary tree representing historical pedigree structures at Ancestry, write a function to find the lowest common ancestor of two nodes. Represent each node as a dictionary with value, left, and right keys; missing children are None. The function receives the root and the unique values of two existing nodes, and returns the value of their lowest common ancestor. Use a single traversal and do not modify the tree.
def lowest_common_ancestor(root, p, q):