I think this should work for you:
lista=[ ['a','b','c','d'],['b','f','g'],['c','h','i'],['d'],['h'],['i'],['f'],['g']]
def tree(root, d):
return [root] + [tree(k, d) for k in d[root]]
d = {i[0]: i[1:] for i in lista}
root = 'a'
print(tree(root, d))
which prints this out:
['a', ['b', ['f'], ['g']], ['c', ['h'], ['i']], ['d']]
Although I believe the dictionary (d) itself might serve you better.