#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  int n;
  cin >> n;
  int i;
  int x, y;
  vector<pair<int, int>> pt;
  vector<int> ans;
  for (i = 0; i < n; i++) {
    cin >> x >> y;
    x = abs(x);
    y = abs(y);
    int cur_ans = (x & 1) + 2 * (y & 1) + 1;
    ans.push_back(cur_ans);
    cin >> x >> y;
  }
  cout << "YES" << '\n';
  for (i = 0; i < n; i++) {
    cout << ans[i] << '\n';
  }
  return 0;
}
