#include <iostream>
using namespace std;
int main() {
int n;
cin>>n;
int a[n+1],odd=0,even;
for(int i=1;i<=n;++i)
{
cin>>a[i];
if(a[i]==1) odd++;
}
even=n-odd;
if(even>0)
{
cout<<2<<" ";
even--;
}
if(odd>0)
{
cout<<1<<" ";
odd--;
}
for(int i=1;i<=even;++i) cout<<2<<" ";
for(int i=1;i<=odd;++i) cout<<1<<" ";
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKaW50IG1haW4oKSB7CglpbnQgbjsKCWNpbj4+bjsKCWludCBhW24rMV0sb2RkPTAsZXZlbjsKCWZvcihpbnQgaT0xO2k8PW47KytpKQoJewoJCWNpbj4+YVtpXTsKCQlpZihhW2ldPT0xKSBvZGQrKzsKCX0KCWV2ZW49bi1vZGQ7CglpZihldmVuPjApIAoJewoJCWNvdXQ8PDI8PCIgIjsKCQlldmVuLS07Cgl9CglpZihvZGQ+MCkKCXsKCQljb3V0PDwxPDwiICI7CgkJb2RkLS07Cgl9Cglmb3IoaW50IGk9MTtpPD1ldmVuOysraSkgY291dDw8Mjw8IiAiOwoJZm9yKGludCBpPTE7aTw9b2RkOysraSkgY291dDw8MTw8IiAiOwoJcmV0dXJuIDA7Cn0=