a, b = gets.split.map(&:to_i) (a..b).each{|n|p n if n%3==0||n.to_s.index('3')}