#include <bits/stdc++.h>
using namespace std;
const int maxn = 5e5 + 10;
int data[maxn][4];
int main(void) {
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    scanf("%d%d%d%d", &data[i][0], &data[i][1], &data[i][2], &data[i][3]);
  }
  printf("YES\n");
  for (int i = 1; i <= n; i++) {
    int a = data[i][0], b = data[i][1];
    if (a % 2 == 0) {
      if (b % 2 == 0)
        printf("1\n");
      else
        printf("2\n");
    } else {
      if (b % 2 == 0)
        printf("3\n");
      else
        printf("4\n");
    }
  }
  return 0;
}
