#include <bits/stdc++.h>
using namespace std;
struct node {
  int x1, x2;
  int y1, y2;
} xin[700000];
int main() {
  int n;
  while (~scanf("%d", &n)) {
    for (int i = 0; i < n; i++) {
      scanf("%d%d", &xin[i].x1, &xin[i].y1);
      scanf("%*d%*d");
    }
    cout << "YES" << endl;
    for (int i = 0; i < n; i++) {
      int x = xin[i].x1;
      int y = xin[i].y1;
      if (!(x & 1) && !(y & 1)) {
        printf("1\n");
      } else if (!(x & 1) && (y & 1)) {
        printf("2\n");
      } else if ((x & 1) && !(y & 1)) {
        printf("3\n");
      } else {
        printf("4\n");
      }
    }
  }
  return 0;
}
