def main():from sys import stdinn=int(stdin.readline())for j in range(n):a=[]for _ in range(10):l,c=map(str,stdin.readline().split())a.append([l,int(c)])a.sort(key=lambda x:(x[1],x[0][::-1]),reverse=True)print(f"Case #{j+1}:")for i in range(10):if a[i][1]!=a[0][1]:for j in range(i-1,-1,-1):print(a[j][0])breakmain()
沒事 過了