#include <bits/stdc++.h>
using namespace std;
int main() {
  int a[2][2];
  int n;
  vector<int> ans;
  ios_base::sync_with_stdio(false);
  cin >> n;
  a[0][0] = 1;
  a[0][1] = 2;
  a[1][0] = 3;
  a[1][1] = 4;
  for (int i = 0; i < n; i++) {
    int x1, y1, x2, y2;
    cin >> x1 >> y1 >> x2 >> y2;
    ans.push_back(a[abs(x1) % 2][abs(y1) % 2]);
  }
  cout << "YES\n";
  for (int i = 0; i < n; i++) cout << ans[i] << '\n';
  return 0;
}
