Problem: You are given a binary string s consisting of n zeros and ones.

Your task is to divide the given string into the minimum number of subsequences in such a way that each character of the string belongs to exactly one subsequence and each subsequence looks like "010101 ..." or "101010 ..." (i.e. the subsequence should not contain two adjacent zeros or ones).

Recall that a subsequence is a sequence that can be derived from the given sequence by deleting zero or more elements without changing the order of the remaining elements. For example, subsequences of "1011101" are "0", "1", "11111", "0111", "101", "1001", but not "000", "101010" and "11100".

You have to answer t independent test cases.

Input

The first line of the input contains one integer t (1 ≤ t ≤ 2 ⋅ 10^4) — the number of test cases. Then t test cases follow.

The first line of the test case contains one integer n (1 ≤ n ≤ 2 ⋅ 10^5) — the length of s. The second line of the test case contains n characters '0' and '1' — the string s.

It is guaranteed that the sum of n does not exceed 2 ⋅ 10^5 (∑ n ≤ 2 ⋅ 10^5).

Output

For each test case, print the answer: in the first line print one integer k (1 ≤ k ≤ n) — the minimum number of subsequences you can divide the string s to. In the second line print n integers a_1, a_2, ..., a_n (1 ≤ a_i ≤ k), where a_i is the number of subsequence the i-th character of s belongs to.

If there are several answers, you can print any.

Example

Input


4
4
0011
6
111111
5
10101
8
01010000


Output


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

Solution (in JAVA):

Solution:
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.ArrayDeque;
import java.util.StringTokenizer;

public class Solve {
    static final int MOD = 1000000007;

    public static void main(String[] args) throws Exception {
        FastScanner in = new FastScanner();
        PrintWriter out = new PrintWriter(System.out);

        int t = in.nextInt();
        while (t-- > 0)
            solve(in, out);
        out.flush();
        out.close();

    }

    private static void solve(FastScanner in, PrintWriter out) throws Exception {
        int n=in.nextInt();
        char[] str=in.readLine().toCharArray();
        ArrayDeque<Integer> os=new ArrayDeque<>(),zs=new ArrayDeque<>();
        int[] count=new int[n];
        int ind=0;
        for(int i=0;i<n;i++){
            if(str[i]=='0'){
                if(os.isEmpty()){
                    ind++;
                    count[i]=ind;
                    zs.addLast(ind);
                }else{
                    int j=os.removeFirst();
                    count[i]=j;
                    zs.addFirst(j);
                }
            }else{
                if(zs.isEmpty()){
                    ind++;
                    count[i]=ind;
                    os.addLast(ind);
                }else{
                    int j=zs.removeFirst();
                    count[i]=j;
                    os.addFirst(j);
                }
            }
        }
        out.println(ind);
        for(int i:count)out.print(i+" ");
        out.println();
    }

    private static int upperBound(int[] arr, int key) {
        int low = 0;
        int high = arr.length - 1;

        while (low < high) {
            int mid = low + (high - low) / 2;
            if (arr[mid] <= key) {
                low = mid + 1;
            } else
                high = mid;
        }
        return low;
    }

    private static long power(long n, long p, long m) {

        long result = 1;

        while (p > 0) {
            if (p % 2 == 1)
                result = (result * n) % m;
            n = (n * n) % m;
            p >>= 1;
        }
        return result;
    }

    private int gcd(int a, int b) {
        if (b == 0)
            return a;
        else
            return gcd(b, a % b);
    }

    private static void shuffle(int a[], int n) {
        for (int i = 0; i < n; i++) {

            int t = (int) Math.random() * a.length;
            int x = a[t];
            a[t] = a[i];
            a[i] = x;
        }
    }

    private static void sieve(int n) {
        boolean[] prime = new boolean[n];
        for (int i = 0; i < n; i++)
            prime[i] = true;
        for (int i = 2; i * i < n; i++) {
            if (prime[i]) {
                for (int j = i * i; j < n; j += i)
                    prime[j] = false;
            }
        }
        for (int i = 2; i < prime.length; i++) {
            if (prime[i])
                System.out.print(i + " ");
        }

    }

    private static void segmentedSieve(int low, int high) {

        int sqrt = (int) Math.sqrt(high);
        int[] prime = new int[sqrt + 1];
        boolean[] arr = new boolean[sqrt + 1];

        for (int i = 0; i <= sqrt; i++)
            arr[i] = true;

        int k = 0;
        for (int i = 2; i <= sqrt; i++) { // generate all prime numbers till square root of high
            if (arr[i]) {
                prime[k] = i;

                k++;
                for (int j = i * i; j <= sqrt; j += i)
                    arr[j] = false;

            }
        }
        // System.out.println(Arrays.toString(prime));

        int diff = high - low + 1; // arr size of required length
        arr = new boolean[diff];
        for (int i = 0; i < diff; i++)
            arr[i] = true;

        for (int i = 0; i < k; i++) { // mark false to multiple of prime numbers in the range of low to high
            int div = (low / prime[i]) * prime[i]; // It gives multiple of prime[i] nearest to low
            if (div < low || div == prime[i])
                div += prime[i];
            for (int j = div; j <= high; j += prime[i]) {
                if (j != prime[i])
                    arr[j - low] = false;
            }
        }
        for (int i = 0; i < diff; i++) { // print prime numbers in the given segment
            if (arr[i] && (i + low) != 1) {
                System.out.print(i + low + " ");
            }
        }
        System.out.println();

    }

    static class Pair implements Comparable<Pair> {
        int a;
        int b;

        public Pair(int a, int b) {
            this.a = a;
            this.b = b;
        }

        @Override
        public int compareTo(Pair o) {
            if (this.a > o.a)
                return this.a - o.a;
            else if (this.a < o.a)
                return this.b - o.b;

            else
                return 0;

        }
    }

    static class FastScanner {
        BufferedReader br;
        StringTokenizer st;

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

        }

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

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

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

                e.printStackTrace();
            }
            return str;
        }

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

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

        int[] readArray(int n) {
            int[] arr = new int[n];
            for (int i = 0; i < n; i++)
                arr[i] = nextInt();
            return arr;
        }

    }
}