#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using pil = pair<int, ll>;
using pli = pair<ll, int>;
using piii = pair<int, pii>;
using plll = pair<ll, pll>;
using pib = pair<int, bool>;
using pdi = pair<double, int>;
using pid = pair<int, double>;
using ld = long double;
using piiii = pair<pii, pii>;
ll gcd(ll a, ll b) { return b == 0 ? a : gcd(b, a % b); }
ll lcm(ll a, ll b) { return a * b / gcd(a, b); }
ll fpow(ll b, ll exp, ll mod) {
  if (exp == 0) return 1;
  ll t = fpow(b, exp / 2, mod);
  if (exp & 1) return t * t % mod * b % mod;
  return t * t % mod;
}
ll divmod(ll i, ll j, ll mod) {
  i %= mod, j %= mod;
  return i * fpow(j, mod - 2, mod) % mod;
}
int n, x, a = 0, b = 0;
bool p[400001];
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  p[1] = true;
  for (int i = 4; i <= 400000; i += 2) {
    p[i] = true;
  }
  for (int i = 3; i <= 400000; i += 2) {
    if (!p[i]) {
      for (int j = i * 2; j <= 400000; j += i) {
        p[i] = true;
      }
    }
  }
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> x;
    if (x == 1)
      a++;
    else
      b++;
  }
  if (a == 0) {
    for (int i = 0; i < b; i++) {
      cout << 2 << " ";
    }
    cout << "\n";
    return 0;
  } else if (b == 0) {
    for (int i = 0; i < a; i++) {
      cout << 1 << " ";
    }
    cout << "\n";
    return 0;
  }
  cout << "2 1 ";
  a--;
  b--;
  while (b--) {
    cout << "2 ";
  }
  while (a--) {
    cout << "1 ";
  }
  cout << "\n";
  return 0;
}
