#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
const int INF = 0x3f3f3f3f;
const int maxn = 1e5 + 10;
int main() {
  int n;
  scanf("%d", &n);
  int cnt1 = 0, cnt2 = 0;
  for (int i = 0; i < n; i++) {
    int x;
    scanf("%d", &x);
    if (x == 2)
      cnt2++;
    else
      cnt1++;
  }
  if (cnt2) {
    printf("2 ");
    cnt2--;
  }
  if (cnt1) {
    printf("1 ");
    cnt1--;
  }
  for (int i = 0; i < cnt2; i++) printf("2 ");
  for (int i = 0; i < cnt1; i++) printf("1 ");
}
