{'root': OrderedDict([('a', ['1']), ('aa', [OrderedDict([('b', [OrderedDict
    ([('c', ['2'])]), '2'])])]), ('aaa', ['3']), ('aaaa', [OrderedDict([(
    'bb', ['4'])])]), ('aaaaa', ['5'])])}
a
aa
aaa
aaaa
aaaaa
How can this function be rewritten to implement OrderedDict?