min, max = gets.split.map(&:to_i) for i in min..max if (i % 3 == 0 || i.to_s.include?('3')) puts i end end