• + 0 comments
    if __name__ == '__main__':
        lis=[]
        for _ in range(int(input())):
            name = input()
            score = float(input())
    
            lista = [name,score]
            lis.append(lista)
        
        lis.sort(key=lambda x: x[1],reverse=False)
        
        for i in range(0,len(lis)):
            if lis[i][1]<lis[i+1][1]:
                val = lis[i+1][1]
                break
        new_lis = []
        for i in range(0,len(lis)):
            if lis[i][1] == val:
                new_lis.append(lis[i])
        
        new_lis.sort(key=lambda x: x[0],reverse=False)
        
        for i in range(0,len(new_lis)):
            print(new_lis[i][0])