queries = int(input())
x_cord, y_cord, x_min_max, y_min_max = [], [], [], []

for i in range(queries):
    n = int(input()
    for j in range(n):
        points = input().split()
        x_cord.add(points[0])
        y_cord.add(points[1])
