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:
//package codeforces;
import java.util.*;
import java.io.*;

public class esehi {
  static FastReader scan;
  static PrintWriter pw;
  static int count = 0;

  public static void main(String[] args) {

    new Thread(null, null, "Thread 1", 1 << 27) {
      public void run() {
        try {
          setup();
          solve();
          closeResources();
        } catch (Exception e) {
          e.printStackTrace();
          System.exit(1);
        }
      }
    }.start();
  }

  private static void solve() throws IOException{
    int t = ni();
    while(t-- > 0) {
      int n = ni();
      int data[] = new int[2*n+1];
      for (int i = 0; i < n; i++) {
        data[i] = ni();
        data[i+n] = data[i];
      }
      boolean all_same = true;
      for (int i = 0; i < n && all_same; i++) {
        if(data[i] != data[0]) all_same = false;
      }
      if(all_same) {
        pl(1);
        for (int i = 0; i < n; i++) {
          p(1);
        }
        pl();
        continue;
      }
      if((n&1) == 0) {
        pl(2);
        for (int i = 0; i < n; i++) {
          p(1+i%2);
        }
        pl();
        continue;
      }
      boolean ok = true;
      int index = -1;
      for (int i = 0; i < n && ok; i++) {
        if((data[i] ^ data[i+1]) == 0){
          ok = false;
          index = i;
        }
      }
      if(ok) {
          pl(3);
          for (int i = 0; i < n-1; i++) {
            p(1+i%2);
          }
          p(3);
          pl();
      }
      else {
        int ans[] = new int[n];
        Arrays.fill(ans, -1);
        ans[index%n] = 1;
        ans[(index+1)%n] = 1;
        for (int i = index+2, j = 1; i < index+n; i++, j++) {
          ans[i%n] = 1+j%2;
        }
        pl(2);
        for (int i = 0; i < n; i++) {
          p(ans[i]);
        }
        pl();
      }
    }
  }

  static String ns() throws IOException {
    return scan.readString();
  }


  static int ni() throws IOException {
    return scan.ni();
  }

  static long nl() throws IOException {
    return scan.nl();
  }

  static long[] nla(int n) throws IOException {
    long []data = new long[n];
    for (int i = 0; i < n; i++) {
      data[i] = nl();
    }
    return data;
  }

  static int[] nia(int n) throws IOException {
    int []data = new int[n];
    for (int i = 0; i < n; i++) {
      data[i] = ni();
    }
    return data;
  }

  static void pl() {
    pw.println();
  }

  static void p(Object o) {
    pw.print(o + " ");
  }

  static void pl(Object o) {
    pw.println(o);
  }

  static void psb(StringBuilder sb) {
    pw.print(sb);
  }

  static void pa(Object arr[]) {
    for (Object o : arr) {
      p(o);
    }
    pl();
  }

  static void pa(int arr[]) {
    for (int o : arr) {
      p(o);
    }
    pl();
  }

  static void pa(long arr[]) {
    for (long o : arr) {
      p(o);
    }
    pl();
  }

  static void pa(double arr[]) {
    for (double o : arr) {
      p(o);
    }
    pl();
  }

  static void pa(char arr[]) {
    for (char o : arr) {
      p(o);
    }
    pl();
  }

  static void pa(List list) {
    for (Object o : list) {
      p(o);
    }
    pl();
  }

  static void pa(Object[][] arr) {
    for (int i = 0; i < arr.length; ++i) {
      for (Object o : arr[i]) {
        p(o);
      }
      pl();
    }
  }

  static void pa(int[][] arr) {
    for (int i = 0; i < arr.length; ++i) {
      for (int o : arr[i]) {
        p(o);
      }
      pl();
    }
  }

  static void pa(long[][] arr) {
    for (int i = 0; i < arr.length; ++i) {
      for (long o : arr[i]) {
        p(o);
      }
      pl();
    }
  }

  static void pa( char[][] arr) {
    for (int i = 0; i < arr.length; ++i) {
      for (char o : arr[i]) {
        p(o);
      }
      pl();
    }
  }

  static void pa(double[][] arr) {
    for (int i = 0; i < arr.length; ++i) {
      for (double o : arr[i]) {
        p(o);
      }
      pl();
    }
  }

  static class FastReader {
    private final InputStream stream;
    private final byte[] buf = new byte[8192];
    private int curChar, snumChars;

    public FastReader(InputStream stream) {
      this.stream = stream;
    }

    public int read() {
      if (snumChars == -1)
        throw new InputMismatchException();
      if (curChar >= snumChars) {
        curChar = 0;
        try {
          snumChars = stream.read(buf);
        } catch (IOException e) {
          throw new InputMismatchException();
        }
        if (snumChars <= 0)
          return -1;
      }
      return buf[curChar++];
    }

    public int ni() {
      int c = read();
      while (isSpaceChar(c)) {
        c = read();
      }
      int sgn = 1;
      if (c == '-') {
        sgn = -1;
        c = read();
      }
      int res = 0;
      do {
        res *= 10;
        res += c - '0';
        c = read();
      } while (!isSpaceChar(c));
      return res * sgn;
    }

    public long nl() {
      int c = read();
      while (isSpaceChar(c)) {
        c = read();
      }
      int sgn = 1;
      if (c == '-') {
        sgn = -1;
        c = read();
      }
      long res = 0;
      do {
        res *= 10;
        res += c - '0';
        c = read();
      } while (!isSpaceChar(c));
      return res * sgn;
    }

    public int[] nextIntArray(int n) {
      int a[] = new int[n];
      for (int i = 0; i < n; i++) {
        a[i] = ni();
      }
      return a;
    }

    public String readString() {
      int c = read();
      while (isSpaceChar(c)) {
        c = read();
      }
      StringBuilder res = new StringBuilder();
      do {
        res.appendCodePoint(c);
        c = read();
      } while (!isSpaceChar(c));
      return res.toString();
    }

    public String nextLine() {
      int c = read();
      while (isSpaceChar(c))
        c = read();
      StringBuilder res = new StringBuilder();
      do {
        res.appendCodePoint(c);
        c = read();
      } while (!isEndOfLine(c));
      return res.toString();
    }

    public boolean isSpaceChar(int c) {
      return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
    }

    private boolean isEndOfLine(int c) {
      return c == '\n' || c == '\r' || c == -1;
    }

    public void close() throws IOException {
      if (stream == null) {
        return;
      }
      stream.close();
    }
  }

  private static void setup() {
    scan = new FastReader(System.in);
    pw = new PrintWriter(System.out, true); // set auto flush to true if you want to directly flush to the output stream.
  }

  private static void closeResources() throws IOException {
    pw.flush();
    pw.close();
    scan.close();
  }

}