import java.io.*; import java.util.*; public class Solution { public static void main(String[] args) { Scanner in = new Scanner(System.in); int Q = in.nextInt(); for(int q = 0; qmaxRow) { maxRow = row; } if(col>maxCol) { maxCol = col; } if(rowminRow && rowminCol && col