#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, i, c1 = 0, c2 = 0, sum = 0, j;
  cin >> n;
  long long int a[n], b[n];
  for (i = 0; i < n; i++) {
    cin >> a[i];
    if (a[i] == 1)
      c1++;
    else
      c2++;
    sum = sum + a[i];
  }
  j = n - 1;
  if (n == 1) {
    cout << a[0];
    return 0;
  }
  while (sum > 0) {
    if (sum == 4) {
      if (c1 > 0) {
        b[j] = 1;
        c1--;
        j--;
        sum = sum - 1;
      } else {
        b[j] = 2;
        c2--;
        j--;
        sum = sum - 2;
      }
    } else if (sum % 6 == 1 || sum % 6 == 3 || sum % 6 == 5 || sum % 6 == 4) {
      if (c2 > 0 && sum != 3) {
        b[j] = 2;
        c2--;
        j--;
        sum = sum - 2;
      } else {
        b[j] = 1;
        c1--;
        j--;
        sum = sum - 1;
      }
    } else {
      if (c1 > 0) {
        b[j] = 1;
        c1--;
        j--;
        sum = sum - 1;
      } else {
        b[j] = 2;
        c2--;
        j--;
        sum = sum - 2;
      }
    }
  }
  for (j = 0; j < n; j++) cout << b[j] << " ";
  return 0;
}
