Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from collections import Counter
- if __name__ == "__main__":
- pairs = []
- while True:
- line = input()
- if line == "0": break
- first_part, second_part = line.split(", ")
- authors = first_part.split()
- temi = second_part.split()
- for a in authors:
- for t in temi:
- pairs.append((a, t))
- counter = Counter(pairs)
- maximum = counter.most_common(1)[0][1]
- for pair in counter.most_common():
- if pair[1] == maximum:
- print(pair[0])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement