#include <bits/stdc++.h>
using namespace std;
int n;
int ans[500005];
bool test(int a) { return a % 2; }
int main() {
  scanf("%d", &n);
  int x1, x2, y1, y2;
  for (int i = 0; i < n; i++) {
    scanf("%d %d %d %d", &x1, &y1, &x2, &y2);
    if (test(x1) && test(y1))
      ans[i] = 1;
    else if (!test(x1) && !test(y1))
      ans[i] = 2;
    else if (test(x1) && !test(y1))
      ans[i] = 3;
    else if (!test(x1) && test(y1))
      ans[i] = 4;
  }
  printf("YES\n");
  for (int i = 0; i < n; i++) {
    printf("%d\n", ans[i]);
  }
  return 0;
}
