#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) { return b == 0 ? a : gcd(b, a % b); }
long long lcm(long long a, long long b) { return (a / gcd(a, b)) * b; }
int main() {
  int n;
  scanf("%d", &n);
  vector<int> vec, ekka, dokka;
  int one = 0, two = 0;
  for (int i = 1; i <= n; i++) {
    int num;
    scanf("%d", &num);
    vec.push_back(num);
    if (num == 1)
      one++, ekka.push_back(1);
    else
      two++, dokka.push_back(2);
  }
  if (!one or !two)
    for (int i = 0; i <= vec.size() - 1; i++) printf("%d ", vec[i]);
  else {
    printf("2 1 ");
    if (dokka.size() > 1)
      for (int i = 0; i <= dokka.size() - 2; i++) printf("%d ", dokka[i]);
    if (ekka.size() > 1)
      for (int i = 0; i <= ekka.size() - 2; i++) printf("%d ", ekka[i]);
  }
}
