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