#P2021. faebdc玩扑克

faebdc玩扑克

Description

zky has nn playing cards numbered from 11 to nn. zky arranges them into a sequence. Each time, move the top card to the bottom of the deck, then take the next card out and output it. Repeat until all cards are output. The final output sequence is exactly from 11 to nn. faebdc asks you what the original sequence is. Because faebdc, a "shen niu" (top coder), has already obtained the answer in O(1)\mathcal O (1) time, if you cannot answer within 1 s, faebdc will eat you.

Input Format

An integer nn, representing the number of cards.

Output Format

Output nn integers, representing the original card sequence, separated by spaces.

13
7 1 12 2 8 3 11 4 9 5 13 6 10 

Hint

Constraints: For 100%100\% of the testdata, 1n1061 \le n \le 10^6.

Translated by ChatGPT 5