#include <bits/stdc++.h>
using namespace std;
const int Maxn = 5e5;
struct Rectangle {
  int x0, y0;
  int x1, y1;
  void input() {
    scanf("%d%d", &x0, &y0);
    scanf("%d%d", &x1, &y1);
  }
};
Rectangle rec[Maxn + 5];
int n;
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) rec[i].input();
  printf("YES\n");
  for (int i = 1; i <= n; i++)
    printf("%d\n", 1 + (rec[i].x0 & 1) + ((rec[i].y0 & 1) << 1));
  return 0;
}
