#include <bits/stdc++.h>
using namespace std;
long long n;
void Solve() {
  cin >> n;
  cout << "YES\n";
  while (n--) {
    long long a, b, c, d;
    cin >> a >> b >> c >> d;
    cout << (2 * (a % 2) + b % 2 + 12) % 4 + 1 << "\n";
  }
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int Test_numbers = 1;
  while (Test_numbers--) Solve();
  return 0;
}
