• + 0 comments
    if __name__ == '__main__':
        names,scores = [],[]
        for _ in range(int(input())):
            name = input()
            score = float(input())
            scores.append(score)
            names.append(name)
    print('\n'.join(sorted([name for name,score in dict(zip(names,scores)).items() if score==sorted(set(scores))[1]])))