Cards

No attempts yetTime limit1sMemory limit16 MB

Problem

Lukas loves card games and has invented a new way to shuffle a deck.

There are NN cards, numbered 11 to NN, stacked in the first pile in some order. A second pile starts out empty. You perform exactly NN operations. Let pkp_k be the kk-th prime number (p1=2p_1 = 2, p2=3p_2 = 3, p3=5p_3 = 5, \dots). In the kk-th operation you:

  1. move pk1p_k - 1 cards, one at a time, from the top of the first pile to its bottom, then
  2. take the card now on top of the first pile and place it on top of the second pile.

For example, suppose the first pile holds 1,2,3,4,5,6,71, 2, 3, 4, 5, 6, 7 from top to bottom. Performing an operation with p=5p = 5 first moves the top 44 cards to the bottom, giving 5,6,7,1,2,3,45, 6, 7, 1, 2, 3, 4; then the top card 55 is removed and placed on the second pile, leaving 6,7,1,2,3,46, 7, 1, 2, 3, 4.

Arrange the cards in the first pile so that after all NN operations the second pile reads, from top to bottom, N,N1,,2,1N, N-1, \dots, 2, 1 (that is, card 11 ends up at the very bottom of the second pile).

Input

A single integer NN (2N1000002 \le N \le 100\,000) — the number of cards in the first pile.

Output

Output NN lines. The ii-th line contains aia_i, the number of the card at position ii in the first pile, where position 11 is the top card and position NN is the bottom card.

Note

The first four primes are 2,3,5,72, 3, 5, 7. Starting from the arrangement 2,1,3,42, 1, 3, 4 (top to bottom), the first pile evolves as follows through the four operations:

(2,1,3,4)(3,4,2)(3,4)(4)()(2, 1, 3, 4) \to (3, 4, 2) \to (3, 4) \to (4) \to (\,)

Operation 11 (p1=2p_1 = 2): move card 22 to the bottom, then take card 11. Operation 22 (p2=3p_2 = 3): after two moves the top card is 22, which is taken. Operations 33 and 44 take cards 33 and 44. The second pile, filled from bottom to top, becomes 1,2,3,41, 2, 3, 4 — that is 4,3,2,14, 3, 2, 1 read from the top.