#include <bits/stdc++.h>
using namespace std;
const int MAX = 2e5 + 5;
int n, a[MAX], bk[3];
int ans[MAX];
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> a[i], bk[a[i]]++;
  sort(a + 1, a + n + 1, greater<int>());
  int cur = 0, top = 0, tar;
  for (int i = 1; i <= n; i++) {
    cur += a[i];
    bk[a[i]]--;
    ans[++top] = a[i];
    if (cur == 2) {
      tar = i;
      break;
    }
  }
  if (bk[1] > 0) bk[1]--, cur += 1, ans[++top] = 1, n--;
  for (int i = tar + 1; i <= n; i++) {
    cur += a[i];
    bk[a[i]]--;
    ans[++top] = a[i];
  }
  for (int i = 1; i <= top; i++) printf("%d%c", ans[i], i == top ? '\n' : ' ');
  return 0;
}
