Little Q is enjoying hot pot together with Tangjz. There are n dishes of meat in the boiling water, labeled by 1,2,…,n. The i-th dish of meat will be ready at moment a_i, and it will take Little Q b_i units of time to fully eat it. Little Q can start eating dish i at any moment t≥a_i, and then he has to eat it until moment t+b_i. Little Q can't be eating more than one dish of meat at the same time.
Little Q is called "King of Hot Pot", and he wants to show off before Tangjz by fully eating k dishes of meat as soon as possible. The timer starts at moment 0. Please write a program to help Little Q, for each k independently (1≤k≤n), find k dishes of meat and the order to eat them such that the total time before he fully eats k dishes is minimized. Note that any waiting time is also included in the answer.
The first line contains a single integer T (1≤T≤10,000), the number of test cases. For each test case:
The first line contains an integer n (1≤n≤300,000) denoting the number of dishes of meat.
Each of the following n lines contains two integers a_i and b_i (1≤a_i,b_i≤109) describing a dish of meat.
It is guaranteed that the sum of all n is at most 1,000,000.
For each test case, output a single line containing n integers, the k-th (1≤k≤n) of which is the minimum total time before Little Q can fully eat k dishes of meat.