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.


-----Examples-----
Input
5 4
4 3 1 2

Output
1 1 3 4 4 

Input
5 5
5 4 3 2 1

Output
1 2 3 4 5 



-----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.

Difficulty: interview

Starter code:

Solutions:
n, m = map(int,input().split())
b = list(map(int,input().split()))
ans = [-1]*101
for bb in b:
    for i in range(bb,n+1):
        if ans[i]==-1:
            ans[i]=bb
print(*ans[1:n+1])

"""
Codeforces Round 240 Div 1 Problem A

Author  : chaotic_iak
Language: Python 3.3.4
"""

class InputHandlerObject(object):
    inputs = []

    def getInput(self, n = 0):
        res = ""
        inputs = self.inputs
        if not inputs: inputs.extend(input().split(" "))
        if n == 0:
            res = inputs[:]
            inputs[:] = []
        while n > len(inputs):
            inputs.extend(input().split(" "))
        if n > 0:
            res = inputs[:n]
            inputs[:n] = []
        return res
InputHandler = InputHandlerObject()
g = InputHandler.getInput

############################## SOLUTION ##############################
n,m = g()
n,m = int(n), int(m)
b = g()
a = [0] * n
for i in b:
    for j in range(int(i)-1, n):
        a[j] = i if a[j] == 0 else a[j]
print(" ".join(a))

n,m=map(int,input().split())

L=list(map(int,input().split()))
Q=[1]*n
Ans=[-1]*(n)
for i in range(m):
    x=L[i]-1
    for j in range(x,n):
        if(Q[j]==1):
            Q[j]=0
            Ans[j]=x+1
for item in Ans:
    print(item,end=" ")


n, m = list(map(int, input().split()))
bts = list(map(int, input().split()))

done = [0 for x in range(n)]

for i in bts:
    for j in range(i-1, n):
        if done[j] == 0:
            done[j] = i

[print(x, end=' ') for x in done]
print()


n,m=map(int,input().split())
a=list(map(int,input().split()))
ans=[0]*n
for i in range(m):
    b=a[i]-1
    j=b
    while j<n and ans[j]==0:
        ans[j]=b+1
        j+=1
print(*ans)

n, m = list(map(int, input().split()))
buttons = list(map(int, input().split()))
lamps = [0] * n
for i in buttons:
    l = i-1
    while (l < n) and not lamps[l]:
        lamps[l] = i
        l += 1
print(" ".join(list(map(str, lamps))))


[n, m] = list(map(int, input().split()))
lamps = [0] * n
for x in map(int, input().split()):
    i = x - 1
    while i < n and not lamps[i]:
        lamps[i] = x
        i += 1
print(*lamps)


import sys





[n,m] = list(map(int, sys.stdin.readline().split()))


lamps = [0 for x in range(n+1)]

buttons = list(map(int, sys.stdin.readline().split()))

for b in buttons:
	for i in range(b, n+1):
		if not lamps[i]:
			lamps[i] = b

print(" ".join(map(str, lamps[1:])))













import sys
file = sys.stdin

__author__ = 'RaiaN'

n, m = file.readline().split(' ')
n = int(n)
m = int(m)
ms = [int(val) for val in file.readline().split(' ')]

dsb = [0]*n
for val in ms:
    for i in range(val-1, n):
        if dsb[i] == 0:
            dsb[i] = val

print(' '.join(str(x) for x in dsb))

n, m = list(map(int, input().split()))
b_list = list(map(int, input().split()))
res = [0] * n

for b in b_list:
    for i in range(b-1, n):
        if res[i] == 0:
            res[i] = str(b)

print(' '.join(res))


n, m = list(map(int, input().split(" ")))

b = list(map(int, input().split(" ")))

a = [-1] * n

for i in b:
    for j in range(i - 1, n):
        if a[j] == -1:
            a[j] = i
    
print(" ".join(map(str, a)))


n,m=map(int,input().split())
blist=[int(x) for x in input().split()]
llist=[0]*n

for i in range(m):
    for j in range(blist[i]-1,n):
        if llist[j]==0:
            llist[j]=blist[i]

print(''.join([str(llist[i])+' ' for i in range(n)]))

n, m = list(map(int, input().split()))
c = [int(i) for i in input().split()]
closed = [False] * n
ans = [0] * n
for i in c:
    if closed[0]:
        break
    for j in range(i-1, n):
        if not closed[j]:
            closed[j] = True
            ans[j] = i
        else:
            continue
print(' '.join(str(i) for i in ans))


n, m = list(map(int, input().split()))
our_list = list(map(int, input().split()))
our_list_2 = []
for i in range(n + 1):
    our_list_2.append(0)
for i in range(m):
    for j in range(our_list[i], n + 1):
        if our_list_2[j] == 0:
            our_list_2[j] = our_list[i]
print(' '.join(list(map(str, our_list_2[1:]))))


n,m = list(map(int,input().split()))
out = [-1]*n
bulbs = list(map(int,input().split()))
for i in bulbs:
    j=i-1
    while j < n and out[j] == -1:
        out[j]=str(i)
        j+=1
print(' '.join(out))


n, m = map(int, input().split())
clicks = list(map(int, input().split()))
lamps = [-1] * (n + 1)
pointer = n + 1
for i in range(m):
    for j in range(clicks[i], pointer):
        lamps[j] = clicks[i]
    pointer = min(pointer, clicks[i])
lamps = lamps[1:]
print(*lamps)

n,m=map(int,input().split())
a=list(map(int,input().split()))
b=[0]*n
for i in range(m):
    num=a[i]
    while num<=len(b) and b[num-1]==0:
        b[num-1]=a[i]
        num+=1
for i in range(len(b)):
    print(b[i],end=' ')

def main():
    N, M = map(int, input().split())
    bottoms = list(map(int, input().split()))
    lamps = [[0] * N][0]
    for i in range(M):
        for j in range(bottoms[i] - 1, N):
            if lamps[j] == 0:
                lamps[j] = bottoms[i]
    print(' '.join(map(str, lamps)))
    
main()

# -*- coding: utf-8 -*-
import math
import random
import time

# argv = sys.argv
# argc = len(argv)


def __starting_point():
    room = input().split(' ')
    b = input().split(' ')
    res = [0 for i in range(int(room[0]))]

    for i in range(int(room[1])):
        for num in range(int(b[i])-1,int(room[0])):
            if res[num] == 0:
                res[num] = int(b[i])

    for i in range(len(res)):
        print(repr(res[i]) + ' ', end="")

__starting_point()

lamp, step = map(int, input().split())
steps = list(map(int, input().split()))
lamps = []
for i in range(lamp):
    lamps.append(i + 1)
for i in range(lamp):
    j = 0
    while steps[j] > lamps[i]:
        j += 1
    lamps[i] = steps[j]
print(' '.join(map(str, lamps)))

N, M = list(map(int, input().split()))
arraybi = list(map(int, input().split()))
arraylamp = list(range(1,N+1))
num = 0
array = ""
for lamp in arraylamp:
    while arraybi[num] > lamp:
        num += 1
    array += str(arraybi[num]) + " "
    num = 0
print(array)


n, m = map(int, input().split())
t, p = [m] * n, list(map(int, input().split()))
for i, j in enumerate(p):
    if t[j - 1] == m: t[j - 1] = i
for i in range(n - 1): t[i + 1] = min(t[i], t[i + 1])
for i in range(n): t[i] = p[t[i]]
print(' '.join(map(str, t)))

n,m=list(map(int,input().split()))
b=list(map(int,input().split()))
a=[0]*(n+1)
minb = n+1
for x in b:
    if x<minb:
        minb = x
        a[x] = x
v = a[1]
for i in range(2,n+1):
    if a[i]==0:
        a[i]=v
    else:
        v=a[i]
print(' '.join(map(str,a[1:])))


n,m = tuple(map(int,input().split()))
b = list(map(int,input().split()))
a = [0]*n
for i in b:
    for j in range(i-1,n):
        if a[j]==0:
            a[j]=str(i)
print(' '.join(a))