#include <bits/stdc++.h>
using namespace std;
int bmod(int y) { return (y % 2 + 2) % 2; }
int main() {
  ios_base::sync_with_stdio(false);
  int n;
  cin >> n;
  vector<int> vec(n);
  int a, b, c, d;
  for (int i = 0; i < n; ++i) {
    cin >> a >> b >> c >> d;
    vec[i] = 1 + bmod(a) + 2 * bmod(b);
  }
  cout << "YES\n";
  for (int i = 0; i < n; ++i) cout << vec[i] << "\n";
  return 0;
}
