Here is a little code to get you started (add your own beautifications as needed):
>>> def make_links(data):
'Create a dictionary mapping nodes to a set of their successors'
links = {}
for row in data:
nodes = row.replace(' ', '').split('->')
for a, b in zip(nodes[:-1], nodes[1:]):
links.setdefault(a, set()).add(b)
return links
>>> def draw_tree(links, start, depth=0):
'Recursively print a tree from a given starting point and given depth'
print(' ' * depth + start)
for node in sorted(links.get(start, [])):
draw_tree(links, node, depth+1)
>>> data = ['A', 'A -> B -> C -> D -> Z', 'A -> B -> O', 'A -> X']
>>> links = make_links(data)
>>> links
{'A': {'X', 'B'}, 'C': {'D'}, 'B': {'C', 'O'}, 'D': {'Z'}}
>>> draw_tree(links, start='A')
A
B
C
D
Z
O
X