#include <iostream>
#include <cstdlib>
#include <algorithm>
#include <vector>
#define F first
#define S second
using namespace std;
typedef long long ll;
const int N = 37e6;
pair<ll, ll> t[111];
ll mod = 98765431;
ll asd = 1007;
bool comp(pair<ll, ll> a, pair<ll, ll> b) {
return a > b;
}
int main() {
srand(time(0));
ll rr = rand()%mod;
int n;
cin>>n;
pair<ll, vector<int> > best = {1e18, {0}};
ll sum = 0;
int mi = 1e9;
for(int i = 0; i < n; ++i) {
cin>>t[i].F;
t[i].S = i;
sum += t[i].F;
mi = min(t[i].F, mi);
}
if(mi >= 500) return -1;
sort(t, t+n, comp);
for(int i = 0; i < N/n; ++i) {
//random_shuffle(t, t+n);
ll a = sum/2;
ll left = sum;
vector<int> v(n);
for(int j = 0; j < n; ++j) {
rr *= asd;
rr %= mod;
ll r = rr%1000;
//if(r/1000 < a/left) {
if(r*left < 1000*a) {
//if(r < 500) {
left -= t[j].F;
a -= t[j].F;
v[t[j].S] = 1;
}
else {
left -= t[j].F;
v[t[j].S] = 2;
}
}
a = abs(a);
best = min(best, {a, v});
}
for(int i = 0; i < n; ++i) {
cout<<best.S[i]<<' ';
}
cout<<'\n';
}