#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, x1, y1, x2, y2;
  cout << "YES" << endl;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> x1 >> y1 >> x2 >> y2;
    if ((x1 % 2 + 2) % 2 == 0 && (y1 % 2 + 2) % 2 == 0) {
      cout << "1" << endl;
    } else if ((x1 % 2 + 2) % 2 == 0 && (y1 % 2 + 2) % 2 == 1) {
      cout << "4" << endl;
    } else if ((x1 % 2 + 2) % 2 == 1 && (y1 % 2 + 2) % 2 == 1) {
      cout << "3" << endl;
    } else {
      cout << "2" << endl;
    }
  }
  return 0;
}
