#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long n;
  cin >> n;
  vector<long long> a(n);
  for (long long i = 0; i < n; i++) cin >> a[i];
  ;
  long long c1 = 0, c2 = 0;
  for (long long i = 0; i < n; i++) {
    if (a[i] == 1)
      c1++;
    else
      c2++;
  }
  sort(a.begin(), a.end());
  if (c1 == 0 || c2 == 0) {
    for (long long i = 0; i < n; i++) {
      cout << a[i] << " ";
    }
    cout << "\n";
    ;
  } else {
    cout << 2 << " ";
    cout << 1 << " ";
    for (long long i = 0; i < c2 - 1; i++) cout << 2 << " ";
    for (long long i = 0; i < c1 - 1; i++) cout << 1 << " ";
    cout << ""
         << "\n";
  }
  return 0;
}
