P2021 faebdc Playing Poker
Background
faebdc and zky are playing a mini game.
Description
zky has $n$ playing cards numbered from $1$ to $n$. 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 $1$ to $n$. faebdc asks you what the original sequence is. Because faebdc, a "shen niu" (top coder), has already obtained the answer in $\mathcal O (1)$ time, if you cannot answer within 1 s, faebdc will eat you.
Input Format
An integer $n$, representing the number of cards.
Output Format
Output $n$ integers, representing the original card sequence, separated by spaces.
Explanation/Hint
Constraints: For $100\%$ of the testdata, $1 \le n \le 10^6$.
Translated by ChatGPT 5