import java.util.Arrays; import java.util.Scanner; class ke implements Comparable{ String op; int v; public ke(){} public ke(String op,int v){ this.op = op; this.v = v; } @Override public int compareTo(ke p1) { // TODO Auto-generated method stub if(!this.op.equals(p1.op)){ //System.out.println(op+" "+p1.op); return this.op.compareTo(p1.op); } else{ //System.out.println("ddd"); return p1.v-this.v; } } } public class Main { public static void main(String[] args) { // TODO Auto-generated method stub Scanner in=new Scanner(System.in); int t=in.nextInt(); while(t-->0){ int n=in.nextInt(); ke []k=new ke[105]; for(int i=0;i<105;i++) k[i]=new ke(); for(int i=0;i