#include <fstream>
#include <algorithm>
#include <cassert>
#include <cstring>

using namespace std;

const int maxN = 200;
const int maxT = 1000000000;

struct evt
{
  int s, t, i;
  evt() {}
  evt( int _s, int _t ): s(_s), t(_t) {}
  bool operator < ( evt b ) const { return s + t < b.s + b.t; }
};
istream & operator >> ( istream &o, evt &e )
{
  istream &t = o >> e.s >> e.t;
  assert(t);
  assert(0 <= e.s && e.s <= maxT);
  assert(0 <= e.t && e.t <= maxT);
  return t;
}
struct pos
{
  int n1, la, fl;
  pos() {}
  pos( int _n1, int _la, int _fl ): n1(_n1), la(_la), fl(_fl) {}
};

evt e[maxN + 1];
int f[maxN + 2][maxN + 1][2];
pos p[maxN + 2][maxN + 1][2];
int ans[maxN + 1];

void relax( pos a, int v, pos c )
{
  if (f[a.n1][a.la][a.fl] < v)
    f[a.n1][a.la][a.fl] = v, p[a.n1][a.la][a.fl] = c;
}

int main()
{
  ifstream in("show.in");
  int n;
  assert(in >> n);
  assert(1 <= n && n <= maxN);
  for (int i = 0; i < n; i++)
    in >> e[i], e[i].i = i;
  in.close();

  e[n++] = evt(-1, 0);
  sort(e, e + n);
  int bval = -1;
  pos bp(-1, -1, -1);
  memset(f, -1, sizeof(f));
  f[0][0][0] = 0;
  for (int n1 = 0; n1 <= n; n1++)
    for (int la = 0; la < n; la++)
      for (int fl = 0; fl < 2; fl++)
      {
        if (f[n1][la][fl] == -1)
          continue;
        int val = f[n1][la][fl];
        for (int i = la + 1, cnt = 0; i < n; i++)
          if (e[la].s + e[la].t <= e[i].s)
          {
            cnt++;
            if (fl)
              relax(pos(n1 + cnt, i, 0), val, pos(n1, la, fl));
            else
              relax(pos(n1, i, 1), val + cnt, pos(n1, la, fl));
          }
        if (min(n1, val) > bval)
          bp = pos(n1, la, fl), bval = min(n1, val);
      }
  assert(bval >= 0);
  for (pos c = bp, x = p[c.n1][c.la][c.fl]; c.la != 0; c = x, x = p[c.n1][c.la][c.fl])
    for (int i = x.la + 1; i <= c.la; i++)
      if (e[x.la].s + e[x.la].t <= e[i].s)
        ans[e[i].i] = x.fl + 1;

  ofstream out("show.out");
  for (int i = 0; i < n - 1; i++)
    out << ans[i] << " \n"[i + 2 == n];
  out.close();
  return 0;
}
