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

import java.math.*;
import java.util.*;
public class Cf_three {
	long gcd(long a,long b) {if(b==0)return a;else return gcd(b,a%b);}
	void swap(long a,long b) {long temp=a;a=b;b=temp;}
	StringBuilder sb=new StringBuilder();
	BigInteger RES=new BigInteger("0");
//	StringBuilder temp=new StringBuilder(str[i-1]);
//	String rev=temp.reverse().toString(); convert sb to string
//	if(str[i].compareTo(rev)>=0)minn=0;-compare two Strings
	//(Initialize as string) - (a.add(b)) - (array initialized with null and not 0)
	Integer[] ARR=new Integer[5];
	//Integer sort-TLE-Initialize object elements i.e a[0].
	long ceil(double d) {return (long)Math.ceil(1.0*d);}
	void divisor(long n,int start) {
		int cnt=0;for(int i=start;i<=Math.sqrt(n);i++) {
		if(n%i==0) {if(i==n/i)cnt++;else cnt+=2;}}}

	public static void main(String[] args) throws IOException {	
		PrintWriter out = new PrintWriter(System.out);
		Readers.init(System.in);
		Cf_three obj=new Cf_three();
		int t=Readers.nextInt();
		for(int z=1;z<=t;z++) {
			int n=Readers.nextInt();
			String s=Readers.next();
			int[] a=new int[n];
			Integer[] ans=new Integer[n];
			ArrayList<Integer> zer=new ArrayList<>();
			ArrayList<Integer> one=new ArrayList<>();
			for (int i = 0; i < a.length; i++) {
				a[i]=Integer.parseInt(String.valueOf(s.charAt(i)));
			}
			int maxx=0;
			for (int i = 0; i < a.length; i++) {
				if(a[i]==1) {
					if(zer.size()==0) {
						one.add(1);
						ans[i]=one.size();
					}
					else {
						one.add(1);
						zer.remove(zer.size()-1);
						ans[i]=one.size();
					}
				}
				else {
					if(one.size()==0) {
						
						zer.add(0);
//						System.out.println(i+"oh"+zer.size());
						ans[i]=zer.size();
						
					}
					else {
						ans[i]=one.size();
						zer.add(0);
						one.remove(one.size()-1);
						
						
					}
				}
				maxx=Math.max(maxx, ans[i]);
//				System.out.println(Arrays.toString(ans)+"sh");
			}
			System.out.println(maxx);
			for (int i = 0; i < ans.length; i++) {
				System.out.print(ans[i]+" ");
			}
			System.out.println();
		}
	}
}
class Readers {
 
    static BufferedReader reader;
 
    static StringTokenizer tokenizer;
 
 
 
    /** call this method to initialize reader for InputStream */
 
    static void init(InputStream input) {
 
        reader = new BufferedReader(
 
                     new InputStreamReader(input) );
 
        tokenizer = new StringTokenizer("");
 
    }
 
 
 
    /** get next word */
 
    static String next() throws IOException {
 
        while ( ! tokenizer.hasMoreTokens() ) {
 
            //TODO add check for eof if necessary
 
            tokenizer = new StringTokenizer(
 
                   reader.readLine() );
 
        }
 
        return tokenizer.nextToken();
 
    }
 
 
 
    static int nextInt() throws IOException {
 
        return Integer.parseInt( next() );
 
    }
 
	
 
    static double nextDouble() throws IOException {
 
        return Double.parseDouble( next() );
 
    }
    
    
    static long nextLong() throws IOException{
    	
		return Long.parseLong(next());
	}
 
}