#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, x1, y1, x2, y2;
  scanf("%d", &n);
  puts("YES");
  while (n--) {
    scanf("%d%d%d%d", &x1, &y1, &x2, &y2);
    if (x1 > x2) swap(x1, x2), swap(y1, y2);
    putchar('1' + (((x1 & 1) << 1) | (y1 & 1)));
    putchar('\n');
  }
  return 0;
}
