def ascan; gets.split.map(&:to_i); end n = gets.to_i 1.upto(99) do |i| sum = 3 + i + (n-2) if sum % 3 == 1 printf "3 #{i} " print [1]*(n-2)*" " puts exit 0 end end