#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, num1 = 0, num2 = 0, a;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a;
    if (a == 1)
      num1++;
    else if (a == 2)
      num2++;
  }
  if (num2 != 0) {
    printf("2 ");
    num2--;
  }
  if (num1 != 0) {
    printf("1 ");
    num1--;
  }
  while (num2--) printf("2 ");
  while (num1--) printf("1 ");
}
