#include <cstdio>
#include <cassert>
#include <algorithm>

using namespace std;

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

int n;
int s[maxN], t[maxN];

int main()
{
  freopen("show.in", "r", stdin);
  freopen("show.out", "w", stdout);

  assert(scanf("%d", &n) == 1);
  assert(1 <= n && n <= maxN);
  for (int i = 0; i < n; i++)
  {
    assert(scanf("%d%d", &s[i], &t[i]) == 2);
    assert(0 <= s[i] && s[i] + t[i] <= maxT);
    t[i] += s[i];
  }
  int ans = -1;
  unsigned pi = 0, pj = 0;
  for (unsigned i = 0; i < (1 << n); i++)
  {
    unsigned j = i;
    do
    {
      bool ok = true;
      for (int k = 0; k < n; k++)
        if (((i >> k) & 1) && !((j >> k) & 1))
          for (int l = 0; l < n; l++)
            if (((i >> l) & 1) && ((j >> l) & 1))
              if (max(s[k], s[l]) < min(t[k], t[l]))
                ok = false;
      if (ok)
      {
        int cnt1 = 0, cnt2 = 0;
        for (int k = 0; k < n; k++)
          if (((i >> k) & 1) && !((j >> k) & 1))
            cnt1++;
          else if (((i >> k) & 1) && ((j >> k) & 1))
            cnt2++;
        if (min(cnt1, cnt2) > ans)
          ans = min(cnt1, cnt2), pi = i, pj = j;
      }
      j = (j - 1) & i;
    } while (j != i);
  }
  assert(ans >= 0);
  for (int i = 0; i < n; i++)
    printf("%u%c", ((pi >> i) & 1) + ((pj >> i) & 1), " \n"[i + 1 == n]);

  return 0;
}
