#include <bits/stdc++.h>
using namespace std;
const long long maxn = 200010;
long long n, a, b, c, d;
long long dz = 1e9;
long long cd[2][2] = {{1, 2}, {3, 4}};
signed main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  cin >> n;
  cout << "YES" << endl;
  for (long long i = 0; i < (long long)(n); i++) {
    cin >> a >> b >> c >> d;
    if (a > c) swap(a, c);
    if (b > d) swap(b, d);
    cout << cd[(c + dz) % 2][(d + dz) % 2] << endl;
  }
}
