#include <bits/stdc++.h>
using pii = std::pair<int, int>;
using ll = long long;
int const MAXN = 111111;
int N;
int main(int argc, char** argv) {
  std::ios_base::sync_with_stdio(false);
  std::cin >> N;
  int a, b, c, d;
  std::cout << "YES" << std::endl;
  for (int n = 0; n < N; ++n) {
    std::cin >> a >> b >> c >> d;
    if (c & 1) {
      if (d & 1)
        std::cout << 1 << std::endl;
      else
        std::cout << 2 << std::endl;
    } else {
      if (d & 1)
        std::cout << 3 << std::endl;
      else
        std::cout << 4 << std::endl;
    }
  }
}
