#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(nullptr);
  int n, input;
  cin >> n;
  int cnt1(0), cnt2(0);
  while (n--) {
    cin >> input;
    if (input == 1) {
      ++cnt1;
    }
    if (input == 2) {
      ++cnt2;
    }
  }
  if (cnt2--) {
    cout << 2 << " ";
  }
  if (cnt1--) {
    cout << 1 << " ";
  }
  while (cnt2-- > 0) {
    cout << 2 << " ";
  }
  while (cnt1-- > 0) {
    cout << 1 << " ";
  }
}
