{"problem":{"name":"Limited Insertion","description":{"content":"Snuke has an empty sequence $a$. He will perform $N$ operations on this sequence. In the $i$\\-th operation, he chooses an integer $j$ satisfying $1 \\leq j \\leq i$, and insert $j$ at position $j$ in $a","description_type":"Markdown"},"platform":"AtCoder","limit":{"time_limit":2000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"agc032_a"},"statements":[{"statement_type":"Markdown","content":"Snuke has an empty sequence $a$.\nHe will perform $N$ operations on this sequence.\nIn the $i$\\-th operation, he chooses an integer $j$ satisfying $1 \\leq j \\leq i$, and insert $j$ at position $j$ in $a$ (the beginning is position $1$).\nYou are given a sequence $b$ of length $N$. Determine if it is possible that $a$ is equal to $b$ after $N$ operations. If it is, show one possible sequence of operations that achieves it.\n\n## Constraints\n\n*   All values in input are integers.\n*   $1 \\leq N \\leq 100$\n*   $1 \\leq b_i \\leq N$\n\n## Input\n\nInput is given from Standard Input in the following format:\n\n$N$\n$b_1$ $\\dots$ $b_N$\n\n[samples]","is_translate":false,"language":"English"}],"meta":{"iden":"agc032_a","tags":[],"sample_group":[["3\n1 2 1","1\n1\n2\n\nIn this sequence of operations, the sequence $a$ changes as follows:\n\n*   After the first operation: $(1)$\n*   After the second operation: $(1,1)$\n*   After the third operation: $(1,2,1)$"],["2\n2 2","\\-1\n\n$2$ cannot be inserted at the beginning of the sequence, so this is impossible."],["9\n1 1 1 2 2 1 2 3 2","1\n2\n2\n3\n1\n2\n2\n1\n1"]],"created_at":"2026-03-03 11:01:14"}}