#include <bits/stdc++.h>
int n, a, cnt1, cnt2;
int main() {
  scanf("%d", &n);
  while (n--) {
    scanf("%d", &a);
    a == 1 ? cnt1++ : cnt2++;
  }
  bool ok = true;
  if (cnt2) {
    cnt2--;
    printf("2");
    ok = false;
  } else {
    for (int i = 0; i < cnt1; i++) printf("1%c", i == cnt1 - 1 ? '\n' : ' ');
    cnt1 = 0;
  }
  if (cnt1) {
    cnt1--;
    if (!ok) printf(" ");
    printf("1");
  } else {
    for (int i = 0; i < cnt2; i++) {
      printf(" 2");
      printf("\n");
    }
    cnt2 = 0;
  }
  if (cnt1 || cnt2) {
    for (int i = 0; i < cnt2; i++) printf(" 2");
    for (int i = 0; i < cnt1; i++) printf(" 1");
    printf("\n");
  }
  return 0;
}
