#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, x, w = 0, c = 0;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> x;
    if (x == 1)
      ++w;
    else
      ++c;
  }
  if (c == n) {
    for (int i = 0; i < n; i++) {
      cout << "2 ";
    }
    cout << endl;
  } else if (w == n) {
    for (int i = 0; i < n; i++) {
      cout << "1 ";
    }
    cout << endl;
  } else {
    cout << "2 1 ";
    for (int i = 0; i < n - 1 - w; i++) {
      cout << "2 ";
    }
    for (int j = 0; j < n - 1 - c; j++) {
      cout << "1 ";
    }
    cout << endl;
  }
  return 0;
}
