n,m=gets.split.map &:to_i d=[0]*(n+1) $<.map{|l|d[l.split[1].to_i]+=1} 1.upto(n){|u|d[u]>0&&(p u)}