Problem: A known chef has prepared dishes: the -th dish consists of grams of fish and grams of meat.
The banquet organizers estimate the balance of dishes as follows. The balance is equal to the absolute value of the difference between the total mass of fish and the total mass of meat.
Technically, the balance equals to . The smaller the balance, the better.
In order to improve the balance, a taster was invited. He will eat exactly grams of food from each dish. For each dish, the taster determines separately how much fish and how much meat he will eat. The only condition is that he should eat exactly grams of each dish in total.
Determine how much of what type of food the taster should eat from each dish so that the value of the balance is as minimal as possible. If there are several correct answers, you may choose any of them.
Input Format: The first line of input data contains an integer () — the number of the test cases.
Each test case's description is preceded by a blank line. Next comes a line that contains integers and (; ). The next lines describe dishes, the -th of them contains a pair of integers and () — the masses of fish and meat in the -th dish.
It is guaranteed that it is possible to eat grams of food from each dish. In other words, for all from to inclusive.
The sum of all values over all test cases in the test does not exceed .
Output Format: For each test case, print on the first line the minimal balance value that can be achieved by eating exactly grams of food from each dish.
Then print lines that describe a way to do this: the -th line should contain two integers and (; ; ), where is how many grams of fish taster should eat from the -th meal and is how many grams of meat.
If there are several ways to achieve a minimal balance, find any of them.