a, b = gets.split.map(&:to_i) (b - a).times do |i| p a + i if (a + i) % 3 == 0 || (a + i).to_s.split('').include?('3') end