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