Codeforces Round 240 (Div. 2)
A
Mashmokh and Lights
Codeforces
900
原题
←B →
翻译中…

Mashmokh works in a factory. At the end of each day he must turn off all of the lights.

翻译中…

The lights on the factory are indexed from $1$ to $*n*$. There are $*n*$ buttons in Mashmokh's room indexed from $1$ to $*n*$ as well. If Mashmokh pushes button with index $*i*$, then each light with index not less than $*i*$ that is still turned on turns off.

翻译中…

Mashmokh is not very clever. So instead of pushing the first button he pushes some of the buttons randomly each night. He pushed $*m*$ distinct buttons $*b*_{1}, *b*_{2}, ..., *b*_{*m*}$ (the buttons were pushed consecutively in the given order) this night. Now he wants to know for each light the index of the button that turned this light off. Please note that the index of button $*b*_{*i*}$ is actually $*b*_{*i*}$, not $*i*$.

翻译中…

Please, help Mashmokh, print these indices.

翻译中…

Input

翻译中…

The first line of the input contains two space-separated integers $*n*$ and $*m*$ $(1 ≤ *n*, *m* ≤ 100)$, the number of the factory lights and the pushed buttons respectively. The next line contains $*m*$ distinct space-separated integers $*b*_{1}, *b*_{2}, ..., *b*_{*m*} (1 ≤ *b*_{*i*} ≤ *n*)$.

翻译中…

It is guaranteed that all lights will be turned off after pushing all buttons.

翻译中…

Output

翻译中…

Output $*n*$ space-separated integers where the $*i*$-th number is index of the button that turns the $*i*$-th light off.

翻译中…

Note

翻译中…

In the first sample, after pressing button number 4, lights 4 and 5 are turned off and lights 1, 2 and 3 are still on. Then after pressing button number 3, light number 3 is turned off as well. Pressing button number 1 turns off lights number 1 and 2 as well so pressing button number 2 in the end has no effect. Thus button number 4 turned lights 4 and 5 off, button number 3 turned light 3 off and button number 1 turned light 1 and 2 off.

翻译中…

样例

Input #1
5 4
4 3 1 2
Output #1
1 1 3 4 4
InputCopy OutputCopy
Input #2
5 5
5 4 3 2 1
Output #2
1 2 3 4 5
InputCopy OutputCopy
题目信息
题号
415A
时间限制
1 s
内存限制
256 MB
标签
模拟

题面与样例版权归 Codeforces 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。