#include <bits/stdc++.h>
using namespace std;
long long MOD = 999999937;
long long MD(long long a, long long b) { return (b + (a % b)) % b; }
signed main() {
  cout << "YES\n";
  int n;
  cin >> n;
  for (int i = 0; i < n; ++i) {
    long long a, b, c, d;
    cin >> a >> b >> c >> d;
    cout << ((100000 - (a % 2) - 2 * (b % 2)) % 4 + 1) << endl;
  }
}
