#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e3 + 5;
const long long mod = 1e9 + 7;
inline long long read() {
  long long ans = 0, flag = 1;
  char c;
  c = getchar();
  while (c < '0' || c > '9') {
    if (c == '-') flag = -1;
    c = getchar();
  }
  while (c >= '0' && c <= '9') {
    ans = ans * 10 + (long long)(c - '0');
    c = getchar();
  }
  return ans * flag;
}
long long quickpow(long long x, long long y, long long mod) {
  long long ans = x % mod;
  while (y) {
    if (y & 1) ans = ans * x % mod;
    x = x * x % mod;
    y >>= 1;
  }
  return ans;
}
int main() {
  int n;
  while (cin >> n) {
    cout << "YES" << endl;
    for (int i = 0; i < n; i++) {
      int x1, x2, y1, y2;
      cin >> x1 >> y1 >> x2 >> y2;
      if (x1 % 2 && y1 % 2)
        cout << 1 << endl;
      else if (x1 % 2 && y1 % 2 == 0)
        cout << 2 << endl;
      else if (x1 % 2 == 0 && y1 % 2)
        cout << 3 << endl;
      else
        cout << 4 << endl;
    }
  }
  return 0;
}
