#include <bits/stdc++.h>
using namespace std;
int main()
{
    long long n,zbir=0;
    cin>>n;
    vector<long long>niza(n);
    for(long long i=0;i<n;i++){
        cin>>niza[i];
        zbir+=niza[i];
    }
    //cout<<zbir/2;
    //return 0;
    vector<long long> rezoid;
    long long zbirs=0,zbirm=0,rez=1e9;
    while (1) {
        random_shuffle(niza.begin(),niza.end());
        for(long long i=0;i<n;i++){
            rezoid.push_back(i);
            if(zbir/2>=zbirs+niza[i]) {
                zbirs+=niza[i];
            }
            else {
                zbirm=zbir-zbirs;
                rez=min(rez,abs(zbirs-zbirm));
            }
            if (zbirs==zbir/2 && zbirm==zbir/2+1 || zbirm==zbir/2) {
                break;
            }
            if (rez!=zbirs-zbirm) {
                for (int j=0;j<n;j++) {
                    rezoid[i]=0;
                }
            }
        }

    }
    for (long long i=0;i<n;i++) {
        cout<<rezoid[i]<<" ";
    }
    return 0;
}