#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n;
  cin >> n;
  int a, n2 = 0, n1 = 0;
  for (int i = 0; i < n; i++) cin >> a, a - 1 ? n2++ : n1++;
  if (n2) cout << 2 << " ";
  if (n1) cout << 1 << " ";
  for (int i = 0; i < n2 - 1; i++) cout << 2 << " ";
  for (int i = 0; i < n1 - 1; i++) cout << 1 << " ";
  return 0;
}
