#include <bits/stdc++.h>
using namespace std;
int sum, one, two;
int n, a[200005];
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    if (a[i] == 1) one++;
    sum += a[i];
  }
  two = n - one;
  if (sum == 1)
    printf("1\n");
  else if (sum == 2) {
    if (one)
      printf("1 1\n");
    else
      printf("2\n");
  } else if (one) {
    if (one == n)
      printf("1 1 "), one -= 2;
    else
      printf("2 "), two--;
    printf("1 ");
    one--;
    while (two--) printf("2 ");
    while (one--) printf("1 ");
    printf("\n");
  } else {
    for (int i = 1; i <= n; i++) printf("2 ");
    printf("\n");
  }
  return 0;
}
