#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  long long x1, y1, x2, y2;
  cout << "YES\n";
  for (int i = 0; i < n; i++) {
    cin >> x1 >> y1 >> x2 >> y2;
    long long a = min(x1, x2);
    long long b = min(y1, y2);
    a = abs(a);
    b = abs(b);
    long long ans = a % 2 + b % 2 * 2;
    ans += 1;
    cout << ans << endl;
  }
  return 0;
}
