Mancala is a family of board games with many rule variants. This problem uses the simplest one, the one player game Tchoukaillon.
Tchoukaillon is played on a board whose pits sit in a single row. The leftmost pit is the Roumba, and the Roumba starts empty. The pits to the right of the Roumba are numbered 1, 2, 3, ... from left to right, and bk is the number of marbles in pit k.

One turn goes in this order.
If marbles remain on the board and no pit satisfies bk=k, the position is lost. The first row of the figure above shows pit 3 being chosen.
If repeated turns move every marble into the Roumba, the position is won, and a starting position that can be played to that end is a winning board. Once the total number of marbles N is fixed, the winning board is always unique. For 4 marbles the only winning board is b1=0, b2=1, b3=3.
Given the total number of marbles N, find the winning board.
The first line holds the number of test cases P. (1≤P≤1000)
Each of the next P lines holds one test case: the case number T and the total number of marbles N placed on the board, separated by a space. (1≤T≤P, 1≤N≤2117)
The bound 2117 is the largest N whose winning board reaches no farther than pit 80.
For each test case, print on one line the case number T and the number B of the rightmost pit that holds at least one marble.
Starting on the next line, print b1 through bB of the winning board in order, ten numbers per line separated by single spaces, with only the remaining numbers on the last line.
B never exceeds 80 in any test case.