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:
/**
 * @Created_by : Lucent868
 * @Date : 10-08-2021
 * @Time :  19:40
 */

import java.util.*;
import java.io.*;
import java.math.*;

public class BinStrSub {
    static InputReader in;
    static PrintWriter out;

    public static void main(String args[]) {
        new Thread(null, new Runnable() {
            public void run() {
                try {
                    solve();
                    out.flush();
                    out.close();
                } catch (Exception e) {
                    e.printStackTrace();
                }
            }
        }, "1", 1 << 26).start();
    }

    public static void solve() {
        in = new InputReader(System.in);
        out = new PrintWriter(System.out);

        int t = in.nextInt();
        while (t-- > 0) {
            int n = in.nextInt();
            char s[] = in.readString().toCharArray();
            int ans[] = new int[n];
            int k= 1;

            if(n == 1)
            {
                out.println(1);
                out.println(1);
                continue;
            }

//            int last[] = new int[n+1];
//            Arrays.fill(last,-1);


            TreeSet<Integer> last1 = new TreeSet<>();
            TreeSet<Integer> last0 = new TreeSet<>();

            ans[0]=1;
            if(s[0] == '0')
            last0.add(1);
            else
                last1.add(1);
//            last[1]=s[0]-'0';


            for (int i = 1; i < n; i++) {
//            out.println(last0+" "+last1);
//                if(s[i] == s[i-1])
//                {
//                    k=1;
//                    while(last[k] == 1 && s[i] == '1'
//                            || last[k] == 0 && s[i] == '0')
//                    {
//                        k++;
//                    }

                    if(s[i] == '0')
                    {
                        if(last1.size()==0)
                        {
                         k=last0.last()+1;
                         last0.add(k);
                        }
                        else
                        {

                            int temp= last1.pollFirst();
                            k = temp;
                            last0.add(k);
                        }
                    }
                    else
                    {

                        if(last0.size() == 0)
                        {
                            k= last1.last()+1;
                            last1.add(k);
                        }
                        else
                        {

                            int temp= last0.pollFirst();
                            k = temp;
                            last1.add(k);
                        }
                    }


                    ans[i] = k;
//                    last[k] = s[i]-'0';
//                }
//                else
//                {
//                    ans[i] =k;
//                    if(s[i] == '1')
//                    {
//                        last0.remove(k);
//                        last1.add(k);
//                    }
//                    else
//                    {
//                        last1.remove(k);
//                        last0.add(k);
//                    }
////                    last[k] = s[i]-'0';
////                    k = 1;
//                }

            }

            int max = 0;
            for (int x:ans)
                max = Math.max(x,max);

            out.println(max);
            for (int i = 0; i < n; i++) {
                out.print(ans[i]+" ");
            }
            out.println();
//            out.println(Arrays.toString(ans));

        }
    }

    static class InputReader {
        private final InputStream stream;
        private final byte[] buf = new byte[8192];
        private int curChar, numChars;
        private SpaceCharFilter filter;

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

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

        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 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 long nextLong() {
            int c = read();
            while (isSpaceChar(c)) {
                c = read();
            }
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            long res = 0;
            do {
                if (c < '0' || c > '9') {
                    throw new InputMismatchException();
                }
                res *= 10;
                res += c - '0';
                c = read();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public int nextInt() {
            int c = read();
            while (isSpaceChar(c)) {
                c = read();
            }
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            int res = 0;
            do {
                if (c < '0' || c > '9') {
                    throw new InputMismatchException();
                }
                res *= 10;
                res += c - '0';
                c = read();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

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

        public long[] nextLongArray(int n) {
            long[] arr = new long[n];
            for (int i = 0; i < n; i++) {
                arr[i] = nextLong();
            }
            return arr;
        }

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

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

        public interface SpaceCharFilter {
            public boolean isSpaceChar(int ch);
        }
    }

    public static int[] sort(int[] arr) {
        List<Integer> temp = new ArrayList();
        for (int i : arr) temp.add(i);
        Collections.sort(temp);
        int start = 0;
        for (int i : temp) arr[start++] = i;
        return arr;
    }

    public static long[] sort(long[] arr) {
        List<Long> temp = new ArrayList();
        for (long i : arr) temp.add(i);
        Collections.sort(temp);
        int start = 0;
        for (long i : temp) arr[start++] = i;
        return arr;
    }

    public static int bs(int[] a, int fromIndex, int toIndex,
                         double key) {
        int low = fromIndex;
        int high = toIndex - 1;

        while (low <= high) {
            int mid = (low + high) >>> 1;
            long midVal = a[mid];

            if (midVal < key)
                low = mid + 1;
            else if (midVal > key)
                high = mid - 1;
            else
                return mid; // key found
        }
        return -(low + 1);  // key not found.
    }

}