require 'tsort'

class Hash
  include TSort
  alias tsort_each_node each_key
  def tsort_each_child(node, &block)
    fetch(node).each(&block)
  end
end

N,M=gets.split(" ").map{|i| i.to_i}
h = {}
revh = {} # child -> parents
for i in 0..(N-1)
	h[i+1] = []
	revh[i+1] = []
end
for i in 0..(N-2+M)
	a,b = gets.split(" ").map{|i| i.to_i}
	h[a].nil? ? h[a] = [b] : h[a] << b
	revh[b].nil? ? revh[b] = [a] : revh[b] << a
end
# p h
tsorted = h.tsort
