#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, i, a, b, x, y, ans = 0;
  scanf("%d", &n);
  printf("YES\n");
  for (int i = 1; i <= n; i++) {
    scanf("%d %d %d %d", &a, &b, &x, &y);
    x = min(a, x);
    y = min(y, b);
    ans = abs(x) % 2;
    ans = ans * 2 + (abs(y) % 2);
    printf("%d\n", ans + 1);
  }
}
