#include <bits/stdc++.h>
using namespace std;
const int MAXN = 500005;
int ans[MAXN];
int main() {
  ios_base::sync_with_stdio(false);
  long long n, x1, y1, x2, y2;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> x1 >> y1 >> x2 >> y2;
    x1 += (long long)(1e9);
    y1 += (long long)(1e9);
    ans[i] = ((x1 & 1) << 1) + (y1 & 1);
  }
  cout << "YES" << endl;
  for (int i = 0; i < n; i++) cout << ans[i] + 1 << "\n";
  return 0;
}
