#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  long long int n, o = 0, t = 0;
  cin >> n;
  for (long long int i = 0; i < n; i++) {
    long long int x;
    cin >> x;
    if (x == 1)
      o++;
    else
      t++;
  }
  if (t) {
    cout << 2 << " ";
    t--;
  }
  if (o) {
    cout << 1 << " ";
    o--;
  }
  while (t--) cout << 2 << " ";
  while (o--) cout << 1 << " ";
}
