#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e6 + 10;
long long x1[MAXN], x2[MAXN], yy[MAXN], y2[MAXN];
int32_t main() {
  long long n;
  cin >> n;
  long long mn = 0;
  for (long long i = 0; i < n; i++) {
    cin >> x1[i] >> yy[i] >> x2[i] >> y2[i];
    mn = min(mn, x1[i]);
    mn = min(mn, x2[i]);
    mn = min(mn, yy[i]);
    mn = min(mn, y2[i]);
  }
  cout << "YES\n";
  mn *= -1;
  for (long long i = 0; i < n; i++) {
    x1[i] += mn;
    x2[i] += mn;
    yy[i] += mn;
    y2[i] += mn;
    long long x = min(x1[i], x2[i]);
    long long y = min(yy[i], y2[i]);
    if (x % 2 == 0 && y % 2 == 0) cout << "1\n";
    if (x % 2 == 1 && y % 2 == 0) cout << "2\n";
    if (x % 2 == 0 && y % 2 == 1) cout << "3\n";
    if (x % 2 == 1 && y % 2 == 1) cout << "4\n";
  }
  return 0;
}
