t | """ | t | |
| 0 / Misdreavus | | |
| Svjatoslav Devjatkov / 3 | | |
| 2 / Yamask | | |
| Vsevid Mladenov / 1 | | |
| 1 / Keldeo | | |
| 0 / Keldeo | | |
| 1 / Misdreavus | | |
| 2 / Scatterbug | | |
| 0 / Crawdaunt | | |
| 2 / Keldeo | | |
| 1 / Vanillite | | |
| Svjatoslav Devjatkov / 0 | | |
| 2 / Gardevoir | | |
| Neljub Mstislavin / 2 | | |
| 2 / Crawdaunt | | |
| 0 / Yamask | | |
| 3 / Reshiram | | |
| """ | | |
| card_name = {} | | card_name = {} |
| people_card = {} | | people_card = {} |
| | | |
| def check_int(s): | | def check_int(s): |
| try: | | try: |
| int(s) | | int(s) |
| return True | | return True |
| except: | | except: |
| return False | | return False |
| while True: | | while True: |
| cur_str = input().split(' / ') | | cur_str = input().split(' / ') |
| if cur_str == ['']: | | if cur_str == ['']: |
| break | | break |
| if check_int(cur_str[0]): | | if check_int(cur_str[0]): |
| cur_str[0] = int(cur_str[0]) | | cur_str[0] = int(cur_str[0]) |
| if cur_str[0] not in card_name: | | if cur_str[0] not in card_name: |
| card_name[cur_str[0]] = set() | | card_name[cur_str[0]] = set() |
| card_name[cur_str[0]].add(cur_str[1]) | | card_name[cur_str[0]].add(cur_str[1]) |
| else: | | else: |
| cur_str[1] = int(cur_str[1]) | | cur_str[1] = int(cur_str[1]) |
| if cur_str[0] not in people_card: | | if cur_str[0] not in people_card: |
| people_card[cur_str[0]] = set() | | people_card[cur_str[0]] = set() |
| people_card[cur_str[0]].add(cur_str[1]) | | people_card[cur_str[0]].add(cur_str[1]) |
| people_count = {} | | people_count = {} |
| max_count = 0 | | max_count = 0 |
| for i in people_card.keys(): | | for i in people_card.keys(): |
| cur_set = set() | | cur_set = set() |
| for j in people_card[i]: | | for j in people_card[i]: |
| cur_set.update(card_name[j]) | | cur_set.update(card_name[j]) |
| temp = len(cur_set) | | temp = len(cur_set) |
| people_count[i] = temp | | people_count[i] = temp |
| if temp > max_count: | | if temp > max_count: |
| max_count = temp | | max_count = temp |
| for i in sorted(people_count): | | for i in sorted(people_count): |
| if people_count[i] == max_count: | | if people_count[i] == max_count: |
| print(i) | | print(i) |