You are given a number n. Your task is to determine two arrays of permutation of size n so that ai≠i for each 1≤i≤n and the sum of |ai−i| for each 1≤i≤n is minimum and maximum possible.
Example
If n=2, then for the minimum difference is 2 and the corresponding array permutation is {2,1}, |2−1|+|1−2|=2 and the maximum difference is also 2 and the corresponding array permutation is {2,1}, |2−1|+|1−2|=2.
Input format
The first line contains an integer n (1≤n≤4×104).
Output format
If there is no permutation for minimum, then print −1 instead of the first and second lines.
If there is no permutation for maximum, then print −1 instead of the third and fourth lines.
given n=3 so if we take {3,1,2} as our permuatation for minimum we will get |3−1|+|1−2|+|2−3|=2+1+1=4 as sum of absolute diffrence with index. you can't get absolute difference less than this without violatiiong condintion ai≠i
for maximum differance we can use {2,3,1} as permutation for maximum. we will get |2−1|+|3−2|+|1−3|=1+1+2=4 as sum of absolute diffrence with index. you can't get absolute difference more than this without violatiiong condintion ai≠i
In this case (n=3) minimum and maximum differance is same