#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  int n;
  cin >> n;
  stack<int> one, two;
  for (int i = 0; i < n; i++) {
    int data;
    cin >> data;
    if (data == 1) {
      one.push(data);
    } else
      two.push(data);
  }
  if ((int)two.size() > 0) {
    cout << 2 << " ";
    two.pop();
  }
  if ((int)one.size() > 0) {
    cout << 1 << " ";
    one.pop();
  }
  while ((int)two.size()) {
    cout << 2 << " ";
    two.pop();
  }
  while ((int)one.size()) {
    cout << 1 << " ";
    one.pop();
  }
  cerr << "Time elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << "s.\n";
  return 0;
}
