#include <bits/stdc++.h>
using namespace std;
void swap(long long int &x, long long int &y) {
  x = x ^ y;
  y = x ^ y;
  x = x ^ y;
}
template <typename T>
void print(T a) {
  for (auto i = a.begin(); i != a.end(); i++) cout << *i << " ";
  cout << endl;
}
bool isVowel(char c) {
  if (c == 'a' || c == 'e' || c == 'i' || c == 'o' || c == 'u') return true;
  return false;
}
void sync() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
}
int main() {
  sync();
  long long int n;
  cin >> n;
  vector<long long int> a(n);
  for (long long int i = 0; i < n; i++) cin >> a[i];
  sort(a.begin(), a.end());
  vector<long long int> b;
  if (a[0] == 2 || a[n - 1] == 1) {
    print(a);
    return 0;
  }
  b.push_back(2);
  b.push_back(1);
  long long int one = 0, two = 0;
  for (long long int i = 0; i < n; i++) {
    if (a[i] == 1)
      one++;
    else
      two++;
  }
  one--;
  two--;
  while (two--) b.push_back(2);
  while (one--) b.push_back(1);
  print(b);
}
