#include <bits/stdc++.h>
using namespace std;
int a, b, c, d, n;
int abse(int x) {
  if (x < 0) {
    return (-x);
  }
  return x;
}
int main() {
  cin >> n;
  cout << "YES" << endl;
  for (int i = 0; i < n; i++) {
    scanf("%d %d %d %d", &a, &b, &c, &d);
    int col = 2 * (abse(a) % 2) + (abse(b) % 2) + 1;
    printf("%d \n", col);
  }
  return 0;
}
