#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
void oj() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
}
static long long dx[] = {-1, 0, 1, 0};
static long long dy[] = {0, 1, 0, -1};
long long binpow(long long a, long long b, long long m) {
  a %= m;
  long long res = 1;
  while (b > 0) {
    if (b & 1) res = res * a % m;
    a = a * a % m;
    b >>= 1;
  }
  return res;
}
int32_t main() {
  oj();
  long long t = 1;
  while (t--) {
    long long n;
    cin >> n;
    vector<long long> a(n);
    long long c1 = 0, c2 = 0;
    for (long long i = 0; i < n; ++i) {
      cin >> a[i];
      if (a[i] == 1)
        c1++;
      else
        c2++;
    }
    if (c2 > 0) {
      cout << "2 ";
      c2--;
    }
    if (c1 > 0) {
      cout << "1 ";
      c1--;
    }
    if (c2 > 0) {
      cout << "2 ";
      c2--;
    }
    for (long long i = 0; i < c2; i++) cout << 2 << ' ';
    for (long long i = 0; i < c1; i++) cout << 1 << ' ';
    cout << "\n";
  }
  return 0;
}
