#include <bits/stdc++.h>
using namespace std;
const int dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1};
const long long linf = 4000000000000000000LL;
const long long inf = 1000000007;
const long double pi = 3.1415926535;
void pv(vector<int> a) {
  for (auto& x : a) cout << x << " ";
  cout << endl;
}
void pv(vector<long long> a) {
  for (auto& x : a) cout << x << " ";
  cout << endl;
}
void pv(vector<vector<int> > a) {
  for (int i = (0); i < (int(a.size())); ++i) {
    cout << i << endl;
    pv(a[i]);
    cout << endl;
  }
}
void pv(vector<vector<long long> > a) {
  for (int i = (0); i < (int(a.size())); ++i) {
    cout << i << endl;
    pv(a[i]);
  }
  cout << endl;
}
void pv(vector<string> a) {
  for (auto& x : a) cout << x << endl;
  cout << endl;
}
void setIO(string second) {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  if (int(second.size())) {
    freopen((second + ".in").c_str(), "r", stdin);
    if (second != "test1") freopen((second + ".out").c_str(), "w", stdout);
  }
}
int main() {
  setIO("");
  int n;
  cin >> n;
  vector<int> a(n);
  for (auto& x : a) cin >> x;
  int one = 0, two = 0;
  for (auto& x : a)
    if (x == 1)
      one++;
    else
      two++;
  if (one == 0) {
    pv(a);
  } else if (one & 1) {
    if (two == 0) {
      pv(a);
    } else {
      sort(a.begin(), a.end());
      a.pop_back();
      a.insert(a.begin(), 2);
      pv(a);
    }
  } else {
    if (two == 0) {
      pv(a);
    } else {
      sort(a.begin(), a.end());
      swap(a[0], a[n - 1]);
      pv(a);
    }
  }
}
