import sys N = int(sys.stdin.readline()) D = {} for _ in range(N): string = sys.stdin.readline().strip() if len(string.split()) == 2: t, c = map(int, string.split()) flag = True for k in range(t-30, t+31): if k in D.keys(): flag = False ...