#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  int n;
  cin >> n;
  cout << "YES\n";
  for (int i = 0; i < n; i++) {
    int x, y, a, b;
    cin >> x >> y >> a >> b;
    x = abs(x), y = abs(y);
    cout << ((x & 1) * 2 + y % 2) % 4 + 1 << '\n';
  }
  return 0;
}
