s,e=gets.split.map(&:to_i) (s..e).each{|i| puts i if i%3===0 || !i.to_s.index('3').nil? }