N,M,*rest = $stdin.read.split.map(&:to_i)

bs = Array.new(N+1)
nodes = Array.new(10**5+1).map { Array.new }
rest.each_slice(2) do |a,b|
  nodes[a] ||= []
  nodes[a] << b
  bs[b] = 1
end

targets = []
1.upto(N+1) do |i|
  unless bs[i]
    targets = [i]
    break
  end
end
as = Array.new(N, 0)

until targets.empty?
  t = targets.pop
  children = nodes[t]
  next unless children
  children.each do |x|
    as[x-1] = t
    unless targets.include?(x)
      targets << x
    end
  end
end

puts as.join("\n")