#include <bits/stdc++.h>
using namespace std;
const int M = 300000;
int a[M];
int main() {
  int n, m = 0, l = 0, i;
  cin >> n;
  for (i = 0; i < n; i++) {
    cin >> a[i];
    if (a[i] == 1)
      m++;
    else
      l++;
  }
  if (m == 2) {
    if (l > 0) cout << "2 ";
    cout << "1 ";
    for (i = 0; i < l - 1; i++) cout << "2 ";
    cout << "1 ";
  }
  if (m >= 3) {
    for (i = 0; i < 3; i++) cout << "1 ";
    for (i = 0; i < l; i++) cout << "2 ";
    for (i = 0; i < m - 3; i++) cout << "1 ";
  }
  if (m == 1) {
    if (l > 0)
      cout << "2 ";
    else
      cout << "1 ";
    if (l > 0) cout << "1 ";
    for (i = 0; i < l - 1; i++) cout << "2 ";
  }
  if (m == 0) {
    for (i = 0; i < n; i++) {
      cout << a[i];
      if (i != n - 1) cout << " ";
    }
  }
  return 0;
}
