#include <bits/stdc++.h>
using namespace std;
const int N = 500005;
int n;
int main() {
  scanf("%d", &n);
  puts("YES");
  for (int i = 1; i <= n; i++) {
    int x1, y1, x2, y2;
    scanf("%d %d %d %d", &x1, &y1, &x2, &y2);
    if (x1 & 1 && y1 & 1)
      puts("1");
    else if (x1 & 1 && !(y1 & 1))
      puts("2");
    else if (!(x1 & 1) && y1 & 1)
      puts("3");
    else
      puts("4");
  }
  return 0;
}
