#include <bits/stdc++.h>
int main() {
  int n, i, j, a[3], count = 0, k = 0, b[30000], m = 0, p = 0, c[30000], q = 0,
                     v = 0;
  scanf("%d", &n);
  for (i = 0; i < n; i++) {
    scanf("%d", &j);
    if (count < 3 && j == 1) {
      a[k] = 1;
      k++;
      count++;
      v = 1;
    } else if (count >= 3 && j == 1) {
      b[m] = 1;
      m++;
    } else {
      c[p] = 2;
      q = 1;
      p++;
    }
  }
  for (i = 0; i < q; i++) printf("2 ");
  if (q == 1) {
    for (i = 0; i < v; i++) printf("1 ");
    m = m + k - 1;
    k = 0;
  }
  for (i = 0; i < k; i++) printf("1 ");
  for (i = 1; i < p; i++) printf("2 ");
  for (i = 0; i < m; i++) printf("1 ");
}
