Skip to content

Permutations

Problem code: myt0147 Group: Training Problem type: Implementation

Time limit
1.0 s
Memory limit
256 MB
Points
10partial
AC rate
100.0%
Solvers
1

A permutation of integers 1,2,\ldots,n is called beautiful if there are no adjacent elements whose difference is 1.

Given n, construct a beautiful permutation if such a permutation exists.

Input

The only input line contains an integer n.

Output

Print a beautiful permutation of integers 1,2,\ldots,n. If there are several solutions, you may print any of them. If there are no solutions, print "NO SOLUTION".

Constraints

1 \le n \le 10^6

Example 1
Input:
5
Output:
4 2 5 3 1
Example 2
Input:
3
Output:
NO SOLUTION

Comments