#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n;
  long long on = 0;
  long long tw = 0;
  long long x;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> x;
    if (x == 1)
      on++;
    else
      tw++;
  }
  if (tw) {
    cout << 2 << " ";
    tw--;
  }
  if (on) {
    cout << 1 << " ";
    on--;
  }
  while (tw--) cout << 2 << " ";
  while (on--) cout << 1 << " ";
  cout << "\n";
}
