n, m = map(int, input().split())
sc = [list(map(int, input().split())) for _ in range(m)]

l = []
for i in sc:
    if i not in l:
        l.append(i)
l.sort()
s = [0]*n
flag = False
for i in range(len(l)):
    s[l[i][0]-1] = l[i][1]
    if l[i-1][0] == l[i][0]:
        flag = True
        break
if flag:
    print(-1)
else:
    if s[0] == 0:
        s[0] == 1
    print(s)