n, a = gets.to_i, $stdin.read.split.map(&:to_i)
zero, one = a.count(0), a.count(1)
a.delete(0)
a.delete(1)
a.sort!

if zero % 2 == 1
  if one >= 1
    w = [0] * (zero - 1) + [1, 0] + [1] * (one - 1)
  elsif a.length >= 1
    w = [0] * (zero - 1) + [a.delete_at(0), 0]
  end
else
  w = [0] * zero + [1] * one
end
b = (a == [2, 3] ? [3, 2] : a) + w

puts b