#!/usr/bin/ruby h=Hash.new{|h,k|h[k]=[]} n,m=gets.split.map(&:to_i) m.times{ a,b=gets.split.map(&:to_i) h[b]<