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