#include <bits/stdc++.h>
using namespace std;
template <typename A, size_t N, typename T>
void Fill(A (&array)[N], const T &val) {
  std::fill((T *)array, (T *)(array + N), val);
}
pair<int, int> Dir[8] = {{0, 1}, {-1, 0}, {1, 0},  {0, -1},
                         {1, 1}, {1, -1}, {-1, 1}, {-1, -1}};
signed main() {
  int n;
  scanf("%d", &n);
  vector<pair<pair<int, int>, int>> in, ou;
  vector<int> ans(n);
  vector<int> used(4, 1);
  printf("YES\n");
  for (int i = (0); (n) > i; i++) {
    int sx, sy, ex, ey;
    scanf("%d %d %d %d", &sx, &sy, &ex, &ey);
    if (sx % 2 && sy % 2) {
      printf("1\n");
      used[0] = 0;
    } else if (sx % 2) {
      printf("2\n");
      used[1] = 0;
    } else if (sy % 2) {
      printf("3\n");
      used[2] = 0;
    } else {
      printf("4\n");
      used[3] = 0;
    }
  }
  return 0;
}
