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