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