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