Problem: The round carousel consists of n figures of animals. Figures are numbered from 1 to n in order of the carousel moving. Thus, after the n-th figure the figure with the number 1 follows. Each figure has its own type — the type of the animal corresponding to this figure (the horse, the tiger and so on). The type of animal of the i-th figure equals t_i.

<image> The example of the carousel for n=9 and t=[5, 5, 1, 15, 1, 5, 5, 1, 1]. 

You want to color each figure in one of the colors. You think that it's boring if the carousel contains two different figures (with the distinct types of animals) going one right after another and colored in the same color.

Your task is to color the figures in such a way that the number of distinct colors used is the minimum possible and there are no figures of the different types going one right after another and colored in the same color. If you use exactly k distinct colors, then the colors of figures should be denoted with integers from 1 to k.

Input

The input contains one or more test cases.

The first line contains one integer q (1 ≤ q ≤ 10^4) — the number of test cases in the test. Then q test cases follow. One test case is given on two lines.

The first line of the test case contains one integer n (3 ≤ n ≤ 2 ⋅ 10^5) — the number of figures in the carousel. Figures are numbered from 1 to n in order of carousel moving. Assume that after the n-th figure the figure 1 goes.

The second line of the test case contains n integers t_1, t_2, ..., t_n (1 ≤ t_i ≤ 2 ⋅ 10^5), where t_i is the type of the animal of the i-th figure.

The sum of n over all test cases does not exceed 2⋅10^5.

Output

Print q answers, for each test case print two lines.

In the first line print one integer k — the minimum possible number of distinct colors of figures.

In the second line print n integers c_1, c_2, ..., c_n (1 ≤ c_i ≤ k), where c_i is the color of the i-th figure. If there are several answers, you can print any.

Example

Input


4
5
1 2 1 2 2
6
1 2 2 1 2 2
5
1 2 1 2 3
3
10 10 10


Output


2
1 2 1 2 2
2
2 1 2 1 2 1
3
2 3 2 3 1
1
1 1 1 

Solution (in JAVA):

Solution:
import javax.swing.*;
import java.io.*;
import java.util.*;
import java.lang.*;

public class B {
    public static PrintWriter out = new PrintWriter(new BufferedOutputStream(System.out));
    static long MOD = (long) (1e9 + 7);
    //static int MOD = 998244353;
    static long MOD2 = MOD * MOD;
    static FastReader sc = new FastReader();
    static int pInf = Integer.MAX_VALUE;
    static int nInf = Integer.MIN_VALUE;
    static long ded = (long)(1e17)+9;
    public static void main(String[] args) throws Exception {
        int test = 1;
        test = sc.nextInt();
        for (int i = 1; i <= test; i++){
            //out.print("Case #"+i+": ");
            solve();
        }
        out.flush();
        out.close();
    }
    static void solve(){
        int n = sc.nextInt();
        HashSet<Integer> A = new HashSet<>();
        int[] a = new int[2*n];
        for(int i = 0; i < n; i++){
            a[i] = sc.nextInt();
            A.add(a[i]);
        }
        for(int i = n; i < 2*n; i++){
            a[i] = a[i-n];
        }
        boolean present = false;
        for(int i = 0; i < 2*n-1; i++){
            if(a[i]==a[i+1]){
                present = true;
            }
        }
        if(A.size()==1){
            out.println(1);
            for(int i = 0; i < n; i++){
                out.print(1+" ");
            }
            out.println();
            return;
        }
        if((n&1)==0){
            out.println(2);
            int p = 1;
            for(int i = 0; i < n; i++){
                out.print(p+" ");
                p = p^3;
            }
            out.println();
            return;
        }
        if(!present){
            out.println(3);
            int p = 1;
            for (int i = 0; i < n - 1; i++) {
                out.print(p + " ");
                p = p ^ 3;
            }
            out.print(3);
            out.println();
            return;
        }
        int idx = -1;
        for(int i = 0 ; i < n; i++){
            if(a[i]==a[(i+1)]){
                idx = i;
            }
        }
        int ans[] = new int[n];
        Arrays.fill(ans,-1);
        ans[idx] = 1;
        ans[(idx+1)%n] = 1;
        int t = (idx+2)%n;
        int p = 2;
        for(int i = 0; i < n-2; i++){
            ans[t] = p;
            p = p^3;
            t = (t+1)%n;
        }
        out.println(2);
        for(int x: ans){
            out.print(x+" ");
        }
        out.println();
    }
    //Pair Class
    static class Pair implements Comparable<Pair> {
        int x;int y;
        int d;
        public Pair(int x, int y) {
            this.x = x;
            this.y = y;
            this.d = y-x;
        }
        @Override
        public int compareTo(Pair o) {
            if(this.d<o.d)return 1;
            return -1;
        }
    }
    //Shuffle Sort
    static final Random random = new Random();
    static void ruffleSort(int[] a) {
        int n = a.length;//shuffle, then sort
        for (int i = 0; i < n; i++) {
            int oi = random.nextInt(n), temp = a[oi];
            a[oi] = a[i];
            a[i] = temp;
        }
        Arrays.sort(a);
    }
    //Brian Kernighans Algorithm
    static long countSetBits(long n) {
        if (n == 0) return 0;
        return 1 + countSetBits(n & (n - 1));
    }
    //Euclidean Algorithm
    static long gcd(long A, long B) {
        if (B == 0) return A;
        return gcd(B, A % B);
    }
    //Modular Exponentiation
    static long fastExpo(long x, long n) {
        if (n == 0) return 1;
        if ((n & 1) == 0) return fastExpo((x * x) % MOD, n / 2) % MOD;
        return ((x % MOD) * fastExpo((x * x) % MOD, (n - 1) / 2)) % MOD;
    }
    //AKS Algorithm
    static boolean isPrime(long n) {
        if (n <= 1) return false;
        if (n <= 3) return true;
        if (n % 2 == 0 || n % 3 == 0) return false;
        for (int i = 5; i <= Math.sqrt(n); i += 6)
            if (n % i == 0 || n % (i + 2) == 0) return false;
        return true;
    }
    public static long modinv(long x) {
        return modpow(x, MOD - 2);
    }
    public static long modpow(long a, long b) {
        if (b == 0) {
            return 1;
        }
        long x = modpow(a, b / 2);
        x = (x * x) % MOD;
        if (b % 2 == 1) {
            return (x * a) % MOD;
        }
        return x;
    }
     static class FastReader {
         BufferedReader br;
         StringTokenizer st;

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

         String next() {
             while (st == null || !st.hasMoreElements()) {
                 try {
                     st = new StringTokenizer(br.readLine());
                 } catch (IOException e) {
                     e.printStackTrace();
                 }
             }
             return st.nextToken();
         }

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

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

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

         String nextLine() {
             String str = "";
             try {
                 str = br.readLine();
             } catch (IOException e) {
                 e.printStackTrace();
             }
             return str;
         }
     }
}