#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  int n, i, j, a;
  cin >> n;
  queue<int> o, t;
  for (i = 0; i < n; i++) {
    cin >> a;
    if (a == 1)
      o.push(1);
    else
      t.push(2);
  }
  if (!t.empty()) {
    cout << t.front() << " ";
    t.pop();
  }
  if (!o.empty()) {
    cout << o.front() << " ";
    o.pop();
  }
  while (!t.empty()) {
    cout << t.front() << " ";
    t.pop();
  }
  while (!o.empty()) {
    cout << o.front() << " ";
    o.pop();
  }
  cout << endl;
}
