There is a n \times 1 board. Its cells are numbered from to . The first four cells initially contain four indistinguishable chips. In one move you may either: - move one chip to a neighboring cell, or - move a chip to a position symmetric with respect to another chip (for example, if a chip is in cell and is reflected over a chip in cell , it will move to cell ), provided that the chip stays within the board and no cell contains more than one chip.
Determine the minimum number of moves required to reach a given configuration.
The first line contains an integer (1 \leq T \leq 10000) — the number of test cases. Each of the next lines contains four integers a_1, a_2, a_3, a_4 (1 \leq a_1, a_2, a_3, a_4 \leq n, n = 70) — the cell numbers for the chips in the final configuration.
For each test case, print an integer — the answer to the problem.
Exemple 1