a = input().split()
A = [int(s) for s in a]
c = [10] * A[0]
b = [input().split() for i in range(A[1])]
B = [[int(s) for s in row]for row in b]
flag = 0
for i in range(A[1]):
  if c[B[i][0]-1] == 10:
    c[B[i][0]-1] = B[i][1]
  elif c[b[i][0]] != B[i][1]:
    flag = 1
if c[0] == 0:
  flag = 1
elif c[0] == 10:
  c[0] = 1
if flag = 0:
  for i in c[1:]:
    if i == 10:
      i = 0
print(c)