#include <bits/stdc++.h>
using namespace std;
const int P = 998244353;
const int N = 2e5 + 5;
const double pi = acos(-1);
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
int n, x, cnt;
int main() {
  scanf("%d", &n);
  for (int i = (1); i <= (n); ++i) {
    scanf("%d", &x);
    cnt += (x == 1);
  }
  if (cnt >= 3) {
    printf("1 1 1");
    for (int i = (1); i <= (n - cnt); ++i) printf(" 2");
    for (int i = (1); i <= (cnt - 3); ++i) printf(" 1");
  } else if (cnt >= 1) {
    if (n - cnt >= 1) {
      printf("2 1");
      for (int i = (1); i <= (n - cnt - 1); ++i) printf(" 2");
      if (cnt == 2) printf(" 1");
    } else {
      for (int i = (1); i <= (n); ++i) printf("1 ");
    }
  } else {
    for (int i = (1); i <= (n); ++i) printf("2 ");
  }
  return 0;
}
