import sys
n, m = map(int, input().split())
s, c = [map(int, input().split())for i in range(m)]

ans = []
for j in range(1,11):
  for i in range(m):
    if s[i] == 1 and c[i] == 0 and n != 1:
      print(-1)
      sys.exit()
    else:
      if s[i] == j:
        ans.append(c[i])
        break
  ans.append(0)
  
print(ans)