#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n;
  cin >> n;
  vector<long long int> ar(n);
  long long int f1 = 0, f2 = 0;
  for (long long int x = 0; x < n; x++) {
    cin >> ar[x];
    if (ar[x] == 1) f1++;
    if (ar[x] == 2) f2++;
  }
  vector<long long int> ans(n);
  long long int sum = 0;
  if (f2 != 0) {
    ans[0] = 2;
    f2--;
    sum = 2;
  } else {
    ans[0] = 1;
    f1--;
    sum = 1;
  }
  for (long long int x = 1; x < n; x++) {
    if (f1 != 0 && f2 != 0) {
      long long int t1 = sum + 1;
      bool pr = true;
      for (long long int y = 2; y * y <= t1; y++) {
        if (t1 % y == 0) {
          pr = false;
          break;
        }
      }
      if (pr) {
        sum += 1;
        ans[x] = 1;
        f1--;
      } else {
        sum += 2;
        ans[x] = 2;
        f2--;
      }
    } else if (f1 != 0) {
      sum += 1;
      f1--;
      ans[x] = 1;
    } else if (f2 != 0) {
      sum += 2;
      f2--;
      ans[x] = 2;
    }
  }
  for (long long int x : ans) {
    cout << x << " ";
  }
  cout << endl;
  return 0;
}
