atcoder#ARC122C. [ARC122C] Calculator

[ARC122C] Calculator

Score : 600600 points

Problem Statement

Snuke has integers xx and yy. Initially, x=0,y=0x=0,y=0.

Snuke can do the following four operations any number of times in any order:

  • Operation 11: Replace the value of xx with x+1x+1.
  • Operation 22: Replace the value of yy with y+1y+1.
  • Operation 33: Replace the value of xx with x+yx+y.
  • Operation 44: Replace the value of yy with x+yx+y.

You are given a positive integer NN. Do at most 130130 operations so that xx will have the value NN. Here, yy can have any value. We can prove that such a sequence of operations exists under the constraints of this problem.

Constraints

  • 1N10181 \leq N \leq 10^{18}
  • All values in input are integers.

Input

Input is given from Standard Input in the following format:

NN

Output

Print your answer in the following format:

KK

t1t_1

t2t_2

\vdots

tKt_K

Here, KK (0K130)(0 \leq K \leq 130) denotes the number of operations, and tit_i(1ti4)(1 \leq t_i \leq 4) represents the ii-th operation to be done.

4
5
1
4
2
3
1

Here, the values of xx and yy change as follows: (0,0)(0,0)\rightarrow (Operation 11) (1,0)\rightarrow (1,0) \rightarrow (Operation 44) (1,1)\rightarrow (1,1) \rightarrow (Operation 22) (1,2)\rightarrow (1,2) \rightarrow (Operation 33) (3,2)\rightarrow (3,2) \rightarrow (Operation 11) (4,2)\rightarrow (4,2), and the final value of xx matches NN.