@staticmethod
def b():
    n = int(sys.stdin.readline().rstrip())
    res = dict()
    for _ in range(n):
        (s, p) = sys.stdin.readline().split()
        p = int(p)
        res[s] = p
    tot = sum(res.values())
    for (s, p) in res.items():
        if (p > (tot / 2)):
            print(s)
            return
    print('atcoder')
@staticmethod
def b():
    n = int(sys.stdin.readline().rstrip())
    res = dict()
    for _ in range(n):
        (s, p) = sys.stdin.readline().split()
        p = int(p)
        res[s] = p
    tot = sum(res.values())
    for (s, p) in res.items():
        if (p > (tot / 2)):
            print(s)
            return
    print('atcoder')