n,m = gets.split(" ").map(&:to_i)
a = Array.new(n, 0)

m.times do
  s,c = gets.split(" ").map(&:to_i)
  if a[s-1] == 0
    a[s-1] = c
  elsif a[s-1] < c
  end
end


if a[0] == 0
  print(-1)
else
  print(a.join())
end
