#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, a, x = 0, y = 0;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a;
    if (a == 1)
      x++;
    else
      y++;
  }
  if (y) {
    cout << "2 ";
    y--;
  }
  if (x) {
    cout << "1 ";
    x--;
  }
  for (int i = 0; i < y; i++) cout << "2 ";
  for (int i = 0; i < x; i++) cout << "1 ";
  return 0;
}
