puts Range.new(*gets.split.map(&:to_i)).select{|i|i%3==0||i.to_s.include?('3')}