#include <bits/stdc++.h>
int main() {
  int n, x, ones = 0, twos = 0;
  scanf("%d", &n);
  while (n--) {
    scanf("%d", &x);
    ones += (x == 1);
    twos += (x == 2);
  }
  if (twos) {
    printf("2 ");
    twos--;
  }
  if (ones) {
    printf("1 ");
    ones--;
  }
  while (twos--) {
    printf("2 ");
  }
  while (ones--) {
    printf("1 ");
  }
  puts("");
}
