#include <bits/stdc++.h>
using namespace std;
const int MAXN = 500005;
int n;
int main() {
  scanf("%d", &n);
  puts("YES");
  for (int i = 1; i <= n; i++) {
    int x1, y1, x2, y2;
    scanf("%d%d%d%d", &x1, &y1, &x2, &y2);
    int ans;
    if (x1 % 2 && y1 % 2)
      ans = 1;
    else if (x1 % 2)
      ans = 2;
    else if (y1 % 2)
      ans = 3;
    else
      ans = 4;
    cout << ans << endl;
  }
}
