• + 0 comments

    n=[] s=[] l=[] a=int(input()) for i in range(a): name = input() score = float(input()) n.append([name,score]) s.append(score) o=min(s) while o in s: i=s.index(o) n.pop(i) s.remove(o) x=min(s) while x in s: i=s.index(x) l.append(n[i]) n.remove(n[i]) s.remove(s[i]) l.sort() for i in l: print(i[0])