#include <bits/stdc++.h>
using namespace std;
int IN() {
  int x = 0, f = 0, ch;
  for (; (ch = getchar()) < '0' || ch > '9';) f = (ch == '-');
  for (; ch >= '0' && ch <= '9'; (ch = getchar())) x = x * 10 + ch - '0';
  return f ? -x : x;
}
int N;
int main(int argc, char* argv[]) {
  N = IN();
  puts("YES");
  for (int i = 1, lim = N; i <= lim; i++) {
    int x1, y1, x2, y2;
    scanf("%d%d%d%d", &x1, &y1, &x2, &y2);
    x1 += 1000000000;
    y1 += 1000000000;
    x1 &= 1;
    y1 &= 1;
    printf("%d\n", x1 * 2 + y1 + 1);
  }
  return 0;
}
