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