import java.io.*;
import java.util.*;
import java.math.*;

public class show_aa implements Runnable {

	public static void main(String[] args) {
		new Thread(new show_aa()).start();
	}

	BufferedReader br;
	StringTokenizer st;
	PrintWriter out;
	boolean eof = false;
	Random rand = new Random(this.hashCode());

	@Override
	public void run() {
		long time = System.currentTimeMillis();
		Locale.setDefault(Locale.US);
		try {
			br = new BufferedReader(new FileReader(FNAME + ".in"));
			out = new PrintWriter(FNAME + ".out");
			solve();
			out.close();
		} catch (Throwable e) {
			e.printStackTrace();
			System.exit(566);
		}
		System.out.println((System.currentTimeMillis() - time) / 1000.0);
	}

	String nextToken() {
		while (st == null || !st.hasMoreTokens()) {
			try {
				st = new StringTokenizer(br.readLine());
			} catch (Exception e) {
				eof = true;
				return "0";
			}
		}
		return st.nextToken();
	}

	int nextInt() {
		return Integer.parseInt(nextToken());
	}

	void myAssert(boolean u, String message) {
		if (!u) {
			throw new Error("Assertion failed!!! " + message);
		}
	}

	int inBounds(int x, int l, int r, String name) {
		myAssert(l <= x && x <= r, name + " not in bounds!!! " + x
				+ " not in [" + l + ".." + r + "]");
		return x;
	}

	String FNAME = "show";

	class Perfomance implements Comparable<Perfomance> {
		public Perfomance(int s2, int t2, int i) {
			s = s2;
			t = t2;
			n = i;
		}

		int s, t, n, type;

		@Override
		public int compareTo(Perfomance p) {
			return s + t - p.s - p.t;
		}
	}

	private void solve() throws IOException {
		int n = inBounds(nextInt(), 1, 200, "n");
		Perfomance[] p = new Perfomance[n];
		for (int i = 0; i < p.length; i++) {
			p[i] = new Perfomance(inBounds(nextInt(), 0, 1000000000, "s["
					+ (i + 1) + "]"), inBounds(nextInt(), 1, 1000000000, "t["
					+ (i + 1) + "]"), i);
		}
		Arrays.sort(p);
		int[][] between = new int[n][n];
		for (int i = 0; i < between.length; i++) {
			for (int j = 0; j < between[i].length; j++) {
				for (int k = 0; k <= j; k++) {
					if (p[i].s + p[i].t <= p[k].s) {
						between[i][j]++;
					}
				}
			}
		}
		int[][] a = new int[n][n + 1];
		int[][] pi = new int[n][n + 1];
		int[][] pc = new int[n][n + 1];
		for (int i = 0; i < a.length; i++) {
			Arrays.fill(a[i], Integer.MIN_VALUE);
			Arrays.fill(pi[i], Integer.MIN_VALUE);
			Arrays.fill(pc[i], Integer.MIN_VALUE);
		}
		for (int i = 0; i < a.length; i++) {
			a[i][i + 1] = 0;
			pc[i][i + 1] = 1;
			a[i][0] = i + 1;
			pc[i][0] = 0;
		}
		for (int i = 1; i < a.length; i++) {
			for (int j = 0; j < a.length; j++) {
				for (int k = 0; k < i; k++) {
					if (a[i][j] < a[k][j] + between[k][i]) {
						a[i][j] = a[k][j] + between[k][i];
						pi[i][j] = k;
						pc[i][j] = 0;
					}
					if (j - between[k][i] >= 0
							&& a[i][j] < a[k][j - between[k][i]]) {
						a[i][j] = a[k][j - between[k][i]];
						pi[i][j] = k;
						pc[i][j] = 1;
					}
					if (a[i][j] + j > n) {
						i += 0;
					}
				}
			}
		}
		int maxi = 0;
		int maxj = 0;
		int max = -1;
		for (int i = 0; i < a.length; i++) {
			for (int j = 0; j < a[i].length; j++) {
				if (max < Math.min(j, a[i][j])) {
					max = Math.min(j, a[i][j]);
					maxi = i;
					maxj = j;
				}
			}
		}
		while (maxi >= 0) {
			int nj = maxj;
			for (int i = Math.max(0, pi[maxi][maxj] + 1); i <= maxi; i++) {
				if (pi[maxi][maxj] < 0
						|| p[pi[maxi][maxj]].s + p[pi[maxi][maxj]].t <= p[i].s) {
					if (pc[maxi][maxj] == 0) {
						p[i].type = 1;
					} else {
						p[i].type = 2;
						nj--;
					}

				}
			}
			maxi = pi[maxi][maxj];
			maxj = nj;
		}
		Arrays.sort(p, new Comparator<Perfomance>() {

			@Override
			public int compare(Perfomance p1, Perfomance p2) {
				return p1.n - p2.n;
			}
		});
		for (int i = 0; i < p.length; i++) {
			out.print(p[i].type + " ");
		}
	}
}
