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