Under construction

Still being built. Things may change

Finding a Dongga Sequence

Time limit1sMemory limit1024 MB

Summary
Given N, print any permutation of 1 to N where each pair of adjacent values differs by at least floor(N/2).
Level

Medium4 of 10

Topics
Array, Math, Implementation
Solved
No attempts yet

Problem

A dongga sequence of length NN is a sequence that satisfies the following two conditions.

  • It consists of integers from 11 to NN, and all elements are distinct.
  • The difference between adjacent elements is at least ⌊N2⌋\lfloor \frac{N}{2} \rfloor.

Find any one dongga sequence of length NN. For every valid input, a dongga sequence always exists.

Input

The first line contains NN (1≤N≤5 0001 \le N \le 5\,000), the length of the dongga sequence to find.

Output

On the first line, print any one dongga sequence of length NN. Separate the elements with spaces.

Hint

⌊x⌋\lfloor x \rfloor is the largest integer not greater than xx.

⌊3.7⌋\lfloor {3.7} \rfloor == 33

⌊4⌋\lfloor {4} \rfloor == 44

Examples2

  1. Example 1

    Input
    3
    
    Expected output
    1 2 3
    
  2. Example 2

    Input
    4
    
    Expected output
    2 4 1 3