n = read_line.to_i ls = [] of Int32 2.upto(9) do |i| ls.concat(Array.new(1 << (i - 1), i)) end ls.reverse! ans = [] of Int32 n.times do |i| if i % 2 == 0 ans << 1 else ans << ls.pop end end puts ans.join