One of Timofey's birthday presents is a colourbook in a shape of an infinite plane. On the plane n rectangles with sides parallel to coordinate axes are situated. All sides of the rectangles have odd length. Rectangles cannot intersect, but they can touch each other.

Help Timofey to color his rectangles in 4 different colors in such a way that every two rectangles touching each other by side would have different color, or determine that it is impossible.

Two rectangles intersect if their intersection has positive area. Two rectangles touch by sides if there is a pair of sides such that their intersection has non-zero length

<image> The picture corresponds to the first example

Input

The first line contains single integer n (1 ≤ n ≤ 5·105) — the number of rectangles.

n lines follow. The i-th of these lines contains four integers x1, y1, x2 and y2 ( - 109 ≤ x1 < x2 ≤ 109,  - 109 ≤ y1 < y2 ≤ 109), that means that points (x1, y1) and (x2, y2) are the coordinates of two opposite corners of the i-th rectangle.

It is guaranteed, that all sides of the rectangles have odd lengths and rectangles don't intersect each other.

Output

Print "NO" in the only line if it is impossible to color the rectangles in 4 different colors in such a way that every two rectangles touching each other by side would have different color.

Otherwise, print "YES" in the first line. Then print n lines, in the i-th of them print single integer ci (1 ≤ ci ≤ 4) — the color of i-th rectangle.

Example

Input

8
0 0 5 3
2 -1 5 0
-3 -4 2 -1
-1 -1 2 0
-3 0 0 5
5 2 10 3
7 -3 10 2
4 -2 7 -1


Output

YES
1
2
2
3
2
2
4
1
import java.io.*;
import java.util.LinkedList;
import java.util.Objects;
import java.util.StringTokenizer;
import java.util.TreeSet;

public final class Main {
    static char[] chars = {'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'};
    static char[] chars1 = {'#', '*', '&'};
    static char[] chars2 = {'1', '2', '3', '4', '5', '6', '7', '8', '9', '0'};

    static boolean oneColor = true;
    // x1<0
    // x1+k*2>0;
    // k*2>-x1;
    // k=-x1/2
    public void solve() {
        int n = in.nextInt();
        out.println("YES");
        for (int i = 0; i < n; i++) {
            int x1 = in.nextInt();
            int y1 = in.nextInt();
            int x2 = in.nextInt();
            int y2 = in.nextInt();
            if (x1 < 0) {
                double k = (double)(-x1) / 2;
                x1=(int)(k*2)+2;
            }
            if (y1 < 0) {
                double k = (double)(-y1) / 2;
                y1=(int)(k*2)+2;
            }
            out.println(2 * (x1 % 2) + (y1 % 2) + 1);
        }
    }

    public void check(TreeSet<Integer>[] a, int index, int maincolor, int c[], TreeSet<Integer> is) {
        if (c[index] != maincolor) {
            oneColor = false;
            return;
        }
        if (a[index] != null) {
            for (int i : a[index]) {
                if (!is.contains(i)) {
                    is.add(i);
                    check(a, i, maincolor, c, is);
                }
            }
        }
    }

    static class Library {
        static boolean isPrime(int a) {
            if (a == 1) {
                return false;
            }
            for (int i = 2; i * i <= a; i++) {
                if (a % i == 0)
                    return false;
            }
            return true;
        }

        static long bpow(long x, long n, long m) {
            long count = 1;
            if (n == 0) {
                return 1;
            }
            while (n > 0) {
                if ((n & 1) == 1) {
                    count *= x;
                    count %= m;
                }
                x *= x;
                x %= m;
                n >>= 1;
            }
            return count % m;
        }

        static long GCD(long a, long b) {
            if (b == 0) return a;
            return GCD(b, a % b);
        }
    }

    class Pair<X, Y> implements Comparable<Pair<X, Y>> {

        public X first;
        public Y second;

        public Pair(X first, Y second) {
            this.first = first;
            this.second = second;
        }

        @Override
        public int hashCode() {
            int hash = 7;
            hash = 11 * hash + Objects.hashCode(this.first);
            hash = 11 * hash + Objects.hashCode(this.second);
            return hash;
        }

        @Override
        public boolean equals(Object obj) {
            if (this == obj) {
                return true;
            }
            if (obj == null) {
                return false;
            }
            if (getClass() != obj.getClass()) {
                return false;
            }
            final Pair<?, ?> other = (Pair<?, ?>) obj;
            if (!Objects.equals(this.first, other.first)) {
                return false;
            }
            if (!Objects.equals(this.second, other.second)) {
                return false;
            }
            return true;
        }

        @Override
        public int compareTo(Pair<X, Y> p) {
            return ((Comparable<X>) first).compareTo(p.first);
        }

        @Override
        public String toString() {
            return first + " " + second;
        }
    }

    class Node<E> {
        E element;
        Node<E> next;
        Node<E> prev;

        Node(E element, Node next, Node prev) {
            this.element = element;
            this.next = next;
            this.prev = prev;
        }
    }

    //    -------------I/O-------------    \\
    private FScanner in;

    private PrintWriter out;

    public static void main(String[] args) {
        new Main().runIO();
    }


    void run() {
        try {
            in = new FScanner(new File("input.txt"));
            out = new PrintWriter(new BufferedWriter(new FileWriter(new File("output.txt"))));
            solve();
            out.close();
            in.close();
        } catch (IOException ex) {
            ex.printStackTrace();
        }
    }

    void runIO() {
        in = new FScanner();
        out = new PrintWriter(new BufferedOutputStream(System.out));
        solve();
        out.close();
        in.close();
    }

    class FScanner {

        private BufferedReader br;
        private StringTokenizer st;

        public FScanner() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        public FScanner(File f) {
            try {
                br = new BufferedReader(new FileReader(f));
            } catch (FileNotFoundException ex) {
                ex.printStackTrace();
            }
        }

        void useString(String s) {
            if (s != null) {
                st = new StringTokenizer(s);
            }
        }

        void updateST() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }

        String next() {
            updateST();
            return st.nextToken();
        }

        Long[] nextLongArray() {
            updateST();
            LinkedList<Long> ll = new LinkedList<>();
            while (st.hasMoreElements()) {
                ll.add(Long.parseLong(st.nextToken()));
            }
            Long[] arr = new Long[1];
            return ll.toArray(arr);
        }

        Integer[] nextIntArray() {
            updateST();
            LinkedList<Integer> ll = new LinkedList<>();
            while (st.hasMoreElements()) {
                ll.add(Integer.parseInt(st.nextToken()));
            }
            Integer[] arr = new Integer[1];
            return ll.toArray(arr);
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        long nextLong() {
            return Long.parseLong(next());
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }

        String nextLine() {
            updateST();
            StringBuilder sb = new StringBuilder(st.nextToken());
            while (st.hasMoreElements()) {
                sb.append(st.nextToken());
            }
            return sb.toString();
        }

        void close() {
            try {
                br.close();
            } catch (IOException ex) {
                ex.printStackTrace();
            }
        }

    }
}