a = gets.chomp.split(' ').map{|x| x .to_i} (a[0]..a[1]).each do |k| if k % 3 == 0 puts k elsif k.to_s.include?("3") puts k end end