# a = [{"name": "B", "parents": ["A", "C"]}, {"name": "C", "parents": ["A"]}, {"name": "A", "parents": []}, {"name": "D", "parents":["C", "F"]}, {"name": "E", "parents":["D"]}, {"name": "F", "parents":[]}]
#
# def main():
#     for i in a:
#         b = 1
#         # print(i['name'])
#         for f in a:
#             if i['name'] in f['parents']:
#                 b += 1
#                 print(i['name'] + ' : ' + str(b))
#             else:
#                 print(i['name'] + ' : ' + str(b))
#
# main() 

# if __name__ == '__main__':
#     main()
