#include <bits/stdc++.h>
using namespace std;
int n, x, y;
int main() {
  scanf("%d", &n);
  puts("YES");
  for (int i = 1; i <= n; i++) {
    scanf("%d%d%*d%*d", &x, &y);
    int tmp = ((((x % 2) + 2) % 2) << 1) + (((y % 2) + 2) % 2) + 1;
    printf("%d\n", tmp);
  }
}
