N = int(input()) L = [[str(i), 0] for i in range(10)] d = dict(L) for _ in range(N): I = input().split() for i in range(4): if I[-1] == 'NO': d[I[i]] -= 1 else: d[I[i]] += 1 print(max(d, key = d.get))