E. Hello Hello Void Movies
time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output

Void loves movies and has the ultimate home theater setup. However, this means he has to make his own popcorn—and Void is notoriously bad in the kitchen.

He has asked you to manage the tonjarah (pot) for him. You are given $$$n$$$ popcorn kernels. For the $$$i$$$-th kernel, you are given two integers: $$$P_i$$$ (the exact time it pops) and $$$B_i$$$ (the exact time it burns). A kernel is considered "perfect" if the pot is removed from the heat at time $$$T$$$ such that $$$P_i \le T \lt B_i$$$. It is guaranteed that $$$B_i \gt P_i$$$.

Find the best time $$$T$$$ to remove the pot from the heat to maximize the number of perfect popcorns for Void. If there are multiple times that yield the same maximum number of perfect popcorns, output the earliest possible time.

Input

The first line contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases.

The first line of each test case contains a single integer $$$n$$$ ($$$1 \le n \le 10^5$$$), the number of kernels.

The next $$$n$$$ lines each contain two space-separated integers, $$$P_i$$$ and $$$B_i$$$ ($$$1 \le P_i \lt B_i \le 10^9$$$), representing the pop and burn times of the $$$i$$$-th kernel.

It is guaranteed that the sum of $$$n$$$ over all test cases does not exceed $$$2 \cdot 10^5$$$.

Output

For each test case, print two space-separated integers on a new line: the maximum number of perfect popcorns, and the optimal time $$$T$$$ to remove the pot.

Example
Input
3
3
1 5
3 7
4 6
4
10 20
20 30
15 25
25 35
2
1 2
2 3
Output
3 4
2 15
1 1
Note

In the first case, at $$$T=4$$$, all three kernels are perfect (since $$$1 \le 4 \lt 5$$$, $$$3 \le 4 \lt 7$$$, and $$$4 \le 4 \lt 6$$$).

In the second case, at $$$T=15$$$, the first and third kernels are perfect. At $$$T=25$$$, the third is burned.

In the third case, they do not overlap ($$$B_1 = P_2 = 2$$$). If $$$T=2$$$, the first kernel is already burned. So max perfect is 1 at $$$T=1$$$ (or $$$T=2$$$). The earliest is $$$T=1$$$.