#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n, i, j, l, m, c = 0, s = 1, k = 0, kk = 0;
  cin >> n;
  for (i = 0; i < n; i++) {
    cin >> m;
    c = c + m;
    if (m == 1)
      k++;
    else
      kk++;
  }
  if (kk == 0) {
    for (i = 0; i < n; i++) {
      cout << 1 << " ";
    }
    cout << endl;
  } else {
    cout << 2 << " ";
    if (k > 0) cout << 1 << " ";
    for (i = 0; i < kk - 1; i++) cout << 2 << " ";
    for (i = 0; i < k - 1; i++) cout << 1 << " ";
    cout << endl;
  }
  return 0;
}
