def sprout_leaves(t, values):
    'Sprout new leaves containing the data in values at each leaf in\n    the original tree t and return the resulting tree.\n\n    >>> t1 = tree(1, [tree(2), tree(3)])\n    >>> print_tree(t1)\n    1\n      2\n      3\n    >>> new1 = sprout_leaves(t1, [4, 5])\n    >>> print_tree(new1)\n    1\n      2\n        4\n        5\n      3\n        4\n        5\n\n    >>> t2 = tree(1, [tree(2, [tree(3)])])\n    >>> print_tree(t2)\n    1\n      2\n        3\n    >>> new2 = sprout_leaves(t2, [6, 1, 2])\n    >>> print_tree(new2)\n    1\n      2\n        3\n          6\n          1\n          2\n    '
    if is_leaf(t):
        return tree(label(t), [tree(v) for v in values])
    return tree(label(t), [sprout_leaves(b, values) for b in branches(t)])
Sprout new leaves containing the data in values at each leaf in
the original tree t and return the resulting tree.

>>> t1 = tree(1, [tree(2), tree(3)])
>>> print_tree(t1)
1
  2
  3
>>> new1 = sprout_leaves(t1, [4, 5])
>>> print_tree(new1)
1
  2
    4
    5
  3
    4
    5

>>> t2 = tree(1, [tree(2, [tree(3)])])
>>> print_tree(t2)
1
  2
    3
>>> new2 = sprout_leaves(t2, [6, 1, 2])
>>> print_tree(new2)
1
  2
    3
      6
      1
      2
def sprout_leaves(t, values):
    'Sprout new leaves containing the data in values at each leaf in\n    the original tree t and return the resulting tree.\n\n    >>> t1 = tree(1, [tree(2), tree(3)])\n    >>> print_tree(t1)\n    1\n      2\n      3\n    >>> new1 = sprout_leaves(t1, [4, 5])\n    >>> print_tree(new1)\n    1\n      2\n        4\n        5\n      3\n        4\n        5\n\n    >>> t2 = tree(1, [tree(2, [tree(3)])])\n    >>> print_tree(t2)\n    1\n      2\n        3\n    >>> new2 = sprout_leaves(t2, [6, 1, 2])\n    >>> print_tree(new2)\n    1\n      2\n        3\n          6\n          1\n          2\n    '
    if is_leaf(t):
        return tree(label(t), [tree(v) for v in values])
    return tree(label(t), [sprout_leaves(b, values) for b in branches(t)])