You are given a positive integer N. Construct a sequence of permutations of (1,2,⋯,N), p_1,p_2,…,p_K, that satisfy following conditions, or report that it's impossible.
In other words, they are bijections from 1,2,…,N to 1,2,…,N.
Here, ∘ denotes function composition, and when K=0, q_K∘q_K−1∘⋯∘q_1 is defined as an identity function.
Input is given from Standard Input in the following format:
N
If there is no solution, print −1. Otherwise, print the answer in the following format:
K
p_1,1 p_1,2 ⋯ p_1,N
⋮
p_K,1 p_K,2 ⋯ p_K,N
Here, p_i,j must be a value of p_i(j).
If there are multiple solutions, you can print any of them.
In Sample 1 for x=2,y=1, we can set q_1=p_1,q_2=p_2−1,q_3=p_3 and get q_3(q_2(q_1(2)))=1.