#include <bits/stdc++.h>
using namespace std;
const int MAXN = 200000 + 5;
bool isprime[MAXN * 2];
int ans[MAXN];
int tmp[MAXN];
int n;
int cnt = 0;
int maxn = 0;
void init() {
  isprime[0] = true;
  isprime[1] = true;
  for (int i = 2; i < MAXN * 2; ++i) {
    if (!isprime[i]) {
      for (int j = 2; j * i < MAXN * 2; ++j) {
        isprime[i * j] = true;
      }
    }
  }
}
void dfs(int a, int b, int cnt, int sum, int i) {
  if (a == 0 && b == 0) {
    if (maxn < cnt) {
      for (int j = 0; j < n; ++j) {
        ans[j] = tmp[j];
      }
      maxn = cnt;
    }
    return;
  }
  if (a > 0) {
    int asum = sum + 1;
    tmp[i] = 1;
    dfs(a - 1, b, (!isprime[asum]) ? cnt + 1 : cnt, asum, i + 1);
  }
  if (b > 0) {
    int bsum = sum + 2;
    tmp[i] = 2;
    dfs(a, b - 1, (!isprime[bsum]) ? cnt + 1 : cnt, bsum, i + 1);
  }
}
int main(int argc, char *argv[]) {
  int a = 0, b = 0;
  init();
  cin >> n;
  for (int i = 0; i < n; ++i) {
    int t;
    cin >> t;
    if (t == 1) {
      a++;
    } else if (t == 2) {
      b++;
    }
  }
  int sum = 0;
  for (int i = 0; i < n; ++i) {
    if (!isprime[sum + 1] && a > 0) {
      sum += 1;
      ans[i] = 1;
      a--;
      continue;
    }
    if (!isprime[sum + 2] && b > 0) {
      sum += 2;
      ans[i] = 2;
      b--;
      continue;
    }
    if (b > 0) {
      sum += 2;
      ans[i] = 2;
      b--;
      continue;
    }
    if (a > 0) {
      sum += 1;
      ans[i] = 1;
      a--;
      continue;
    }
  }
  for (int i = 0; i < n; ++i) {
    cout << ans[i] << " ";
  }
  cout << endl;
  return 0;
}
