import java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; public class Solution { public static void main(String[] args) throws Exception { /* Enter your code here. Read input from STDIN. Print output to STDOUT. Your class should be named Solution. */ BufferedReader br = new BufferedReader(new InputStreamReader (System.in)); int q= Integer.parseInt(br.readLine()); String ans; while(q>0) { int n = Integer.parseInt(br.readLine()); int [][] p = new int [n][2]; String [] data = br.readLine().split(" "); p[0][0] = Integer.parseInt(data[0]); p[0][1] = Integer.parseInt(data[1]); int minx = p[0][0]; int miny = p[0][1]; int maxx = minx; int maxy = miny; for(int i=1;ip[i][0]) minx=p[i][0]; if(maxxp[i][1]) miny = p[i][1]; if(maxy