a=gets.chomp.split.map(&:to_i)
i=[]
a[0].times do 
  i.push(0)
end

a[1].times do 
  b=gets.chomp.split.map(&:to_i)
  if i[b[0]-1]<b[1]
  i[b[0]-1]=b[1]
  end
end
if i[0]==0
  puts -1
else puts i.join
end
  