#include <bits/stdc++.h>
using namespace std;
vector<long long> v;
bool p[500010];
long long cnt[3], a[200010];
void sieve() {
  memset(p, 1, sizeof p);
  v.push_back(2);
  for (long long i = 3; i <= 500005; i += 2) {
    if (p[i]) {
      v.push_back(i);
      for (long long j = i * i; j <= 500005; j += 2 * i) {
        p[j] = 0;
      }
    }
  }
}
int main() {
  sieve();
  long long n, x;
  scanf("%lld", &n);
  for (long long i = 1; i <= n; i++) {
    scanf("%lld", &a[i]);
    cnt[a[i]]++;
  }
  long long j = 0, sum = 0;
  for (long long i = 1; i <= n; i++) {
    if (cnt[1] > 0) {
      if (sum + 1 == v[j]) {
        sum += 1;
        cout << "1 ";
        cnt[1]--;
        j++;
        continue;
      }
    }
    if (cnt[2] > 0) {
      if (sum + 2 == v[j]) {
        sum += 2;
        j++;
        cout << "2 ";
        cnt[2]--;
        continue;
      }
    }
    if (cnt[2] > 0) {
      sum += 2;
      if (sum > v[j]) {
        j++;
      }
      cout << "2 ";
      cnt[2]--;
      continue;
    }
    if (cnt[1] > 0) {
      sum++;
      if (sum > v[j]) {
        j++;
      }
      cout << "1 ";
      cnt[1]--;
      continue;
    }
  }
}
