#include <bits/stdc++.h>
using namespace std;
bool IsPrime(long long n) {
  if (n <= 1) return false;
  for (long long i = 2; i <= sqrt(n); i++) {
    if (n % i == 0) return false;
  }
  return true;
}
long long n, now = 0, a, b;
vector<long long> ans;
int main() {
  cin >> n;
  for (long long i = 0; i < n; i++) {
    long long s;
    cin >> s;
    if (s == 1)
      a++;
    else
      b++;
  }
  for (long long i = 0; i < n; i++) {
    if (IsPrime(now + 2) and b > 0) {
      ans.push_back(2);
      now += 2;
      b--;
    } else if (IsPrime(now + 1) and a > 0) {
      ans.push_back(1);
      now++;
      a--;
    } else if (b > 0) {
      ans.push_back(2);
      now += 2;
      b--;
    } else {
      ans.push_back(1);
      now++;
      a--;
    }
  }
  for (long long i = 0; i < n; i++) {
    if (i != 0) cout << " ";
    cout << ans[i];
  }
  cout << endl;
}
