• + 0 comments
    if __name__ == '__main__':
        records={}
        for _ in range(int(input())):
            name = input()
            score = float(input())
            records[name]=score
        for i in sorted([key for key,value in records.items() if value== sorted(set(records.values()))[1]]):
            print(i)