I have a flattened json data like this, aka input data:
data = [\'a\', \'a-aa\', \'a-aa-aaa\', \'a-aa-aab\', \'a-aa-aab-aaba\', \'b\', \'b-ba