#include <bits/stdc++.h>
using namespace std;
int main() {
  cout << "YES\n";
  int n;
  scanf("%d", &n);
  while (n--) {
    int x1, y1, x2, y2;
    scanf("%d%d%d%d", &x1, &y1, &x2, &y2);
    printf("%d\n", (4 + 2 * (y1 % 2) + (x1 % 2)) % 4 + 1);
  }
  return 0;
}
