#include <bits/stdc++.h>
using namespace std;
const int nn = (int)2000000;
const long double eps = 3 * 10e-8;
const long double eps1 = 5 * 10e-8;
const unsigned long long INF = (unsigned long long)(1e19 * 1.7);
const long long mod = 10;
int main() {
  long long n;
  cout << "YES\n";
  cin >> n;
  for (int i = 0; i < n; i++) {
    long long x, y;
    cin >> x >> y;
    cout << ((4 * (long long)1e10 + 2 * (x % 2) + y % 2) % 4) + 1 << ' ';
    cin >> x >> y;
  }
  return 0;
}
