#include <bits/stdc++.h>
using namespace std;
const int N = 10000000;
int lp[N + 1];
vector<int> pr;
int main() {
  for (int i = 2; i <= N; ++i) {
    if (lp[i] == 0) {
      lp[i] = i;
      pr.push_back(i);
    }
    for (int j = 0; j < (int)pr.size() && pr[j] <= lp[i] && i * pr[j] <= N; ++j)
      lp[i * pr[j]] = pr[j];
  }
  int n;
  cin >> n;
  int a1 = 0, a2 = 0;
  while (n--) {
    int u;
    cin >> u;
    if (u == 1)
      a1++;
    else
      a2++;
  }
  if (a1 == 0) {
    while (a2--) cout << 2 << ' ';
    return 0;
  } else if (a2 == 0) {
    while (a1--) cout << 1 << ' ';
    return 0;
  } else {
    cout << "2 1 ";
    --a2;
    --a1;
    while (a2--) cout << 2 << ' ';
    while (a1--) cout << 1 << ' ';
  }
  return 0;
}
