while True: try: n = int(input()) a = [] for i in range(n): a.append(list(map(int,input().split()))) b = [] for i in a: b.append(i[0]) c = [] for i in sorted(list(set(b))): value = 0 for j in a: ...