#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  scanf("%d", &n);
  printf("YES\n");
  for (int i = 0; i < (int)(n); ++i) {
    int x1, y1, x2, y2;
    scanf("%d%d%d%d", &x1, &y1, &x2, &y2);
    if (x1 > x2) swap(x1, x2);
    if (y1 > y2) swap(y1, y2);
    x1 = abs(x1);
    y1 = abs(y1);
    int res = 1;
    if (x1 % 2) ++res;
    if (y1 % 2) res += 2;
    printf("%d\n", res);
  }
  return 0;
}
