• + 0 comments
    if __name__ == '__main__':
    		`#read the number of name and scores`
        records = {}
        for _ in range(int(input())):
    				``#read the records`
            name = input()
            score = float(input())
            records[name] = score
        
    		#find the mininum value of score
        lista = list(records.values())
        m = min(lista)
    		
    		#create a new list without the minimum value
        lista = [x for x in lista if x != m]
    		
    		#find the second minimum value
        m = min(lista)
    		#create a new list with only the name of the second minimum value and print it
        lista = []
        for key in records.keys():
            if records[key] == m:
                lista.append(key)
        lista.sort()
        for name in lista:
            print(name)