M. Merticulous Manipulation
time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output

The Marvelous Maximillian is a stage magician famous for his grand finale, The Perfect Permutation. He claims he can arrange $$$N$$$ cards, numbered $$$1$$$ to $$$N$$$, into any permutation $$$P$$$ requested by the audience.

As his apprentice, you know his secret: it's a precise $$$N$$$-step procedure. The trick starts with an empty pile. For each card $$$i$$$ from $$$1$$$ to $$$N$$$, in order:

  1. Maximillian places card $$$i$$$ on top of the pile.
  2. He immediately asks you for a secret number, $$$x_i$$$ (where $$$1 \le x_i \le i$$$). He takes the top $$$x_i$$$ cards from the pile and moves them, in order, to the bottom. For example, if the pile is [3, 1, 2] (top to bottom) and $$$x = 2$$$, the pile becomes [2, 3, 1].

Tonight, an audience member has demanded the final pile be in the specific order $$$P$$$, where $$$P_1$$$ is the top card and $$$P_N$$$ is the bottom.

Maximillian is on stage and looking at you. You must provide the correct sequence of cut numbers, $$$x_1, x_2, \ldots, x_N$$$, to produce the permutation $$$P$$$ and save the show.

Input

The first line contains a single integer $$$N$$$ ($$$1 \le N \le 2 \cdot 1o^5$$$) — the number of cards.

The second line contains $$$N$$$ integers $$$P_1, P_2, \ldots, P_N$$$($$$1 \le P_i \le N$$$) — the permutation demanded by the audience.

Output

Print one line containing $$$N$$$ integers — the sequence of cut numbers, $$$x_1, x_2, \ldots, x_N$$$.

Examples
Input
5
1 2 3 4 5
Output
1 1 1 1 1
Input
4
4 1 3 2
Output
1 2 2 4
Note

For the first example, every cut is just taking the top card and putting it in the bottom.

For the second example, the pile after each cut is as follows.

  • After first cut: [1]
  • After second cut: [2, 1]
  • After third cut: [1,3,2]
  • After fourth cut: [4,1,3,2]