#include <bits/stdc++.h>
using namespace std;
const int N = 500200;
const int mod = 1e9 + 7;
const long long INF = 1e18;
map<int, vector<int> > g;
int ans[N];
int n;
map<pair<int, int>, int> ba;
int xa[N], ya[N], xb[N], yb[N];
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i) {
    scanf("%d%d%d%d", xa + i, ya + i, xb + i, yb + i);
    if (xa[i] % 2 == 0) {
      if (ya[i] % 2 == 0)
        ans[i] = 1;
      else
        ans[i] = 2;
    } else {
      if (ya[i] % 2 == 0)
        ans[i] = 3;
      else
        ans[i] = 4;
    }
  }
  cout << "YES\n";
  for (int i = 1; i <= n; ++i) printf("%d\n", ans[i]);
  return 0;
}
