#include <bits/stdc++.h>
#pragma GCC optimize("O3")
#pragma GCC target("sse4")
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie();
  int n;
  cin >> n;
  int one = 0, two = 0;
  for (int i = 0; i < n; i++) {
    int a;
    cin >> a;
    if (a == 1) {
      one++;
    } else {
      two++;
    }
  }
  if (two) {
    two--;
    cout << 2 << " ";
  }
  if (one) {
    one--;
    cout << 1 << " ";
  }
  while (two--) {
    cout << 2 << " ";
  }
  while (one--) {
    cout << 1 << " ";
  }
  cout << endl;
  return 0;
}
