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.*;
import java.util.*;
public class Main {
static	int[] freq=new int[101];
static int dp[][];

static int[] inp;
static int n;
public static int solv(int i, int msk){
	if (i==n){
		if(msk==0){
		return 1;}
		else{
			return 0;
		}}
	if(dp[i][msk]!=-1){
		return dp[i][msk];
	}
		if(msk==0){
			return dp[i][msk]= solv(i+1,1)+solv(i+1,4)+solv(i+1,7);
		}
		else if(msk==1){
			return dp[i][msk]= solv(i+1,0)+solv(i+1,3);
	}
		else if(msk==2){
			return dp[i][msk]= solv(i+1,5);
		}
		else if(msk==3){
			return dp[i][msk]= solv(i+1,4);
		}
		else if(msk==4){
			return dp[i][msk]= solv(i+1,0)+solv(i+1,6);
		}
		else if(msk==5){
			return dp[i][msk] =solv(i+1,2);
		}
		else if(msk==6){
			return dp[i][msk]=solv(i+1,1);
		}
		else {
			return dp[i][msk]=solv(i+1,0);
		}
	}

public static int[] ToIntArray(String s){
	int [] r=new int[s.length()];
for (int i=0;i<s.length();i++){
	String res="";
	res+=s.charAt(i);
	r[i]=Integer.parseInt(res);
	
}return r;}
public static int countdigit (long b){
	int res=0;
	while(b>0){
		b/=10;
		res++;
	}
	return res;
}
public static int[] ToDigitArray(long b){
	
	
	int res[]=new int[countdigit(b)];
	for(int i=0;i<res.length;i++){
		res[i]=(int)(b%10);
		b/=10;
	}
   
    return res;
}




public static int histogram(int []input){
	Stack <Integer> s=new Stack<Integer>();
	int i=0;
	int area=0;
	int maxarea=-(int)1e9;
	int top;
	for( i=0;i<input.length;){
		if(s.isEmpty()|| input[i]>=input[s.peek()]){
			s.push(i);
			i++;
			continue;
		}else{
			
				top=s.pop();
				if(!s.isEmpty()){
					 area=input[top]*(i-s.peek()-1);
					 maxarea=Math.max(maxarea, area);
				}
				else{
					area=input[top]*i;
					 maxarea=Math.max(maxarea, area);
				}
				
			}
		}
	
	while(!s.isEmpty()){
		top=s.pop();
		if(!s.isEmpty()){
			 area=input[top]*(i-s.peek()-1);
			 maxarea=Math.max(maxarea, area);
		}
		else{
			area=input[top]*i;
			 maxarea=Math.max(maxarea, area);
		}
		
	}
	return maxarea;
}
public static int maxarea(int [][] arr){
	int maxarea=-1;
	int curr[]=new int [arr.length];
	for(int i=0;i<arr.length;i++){
		for(int j=0;j<arr.length;j++){
			if(arr[i][j]==0){
				curr[j]=0;
			}
			else{
			curr[j]+=arr[i][j];
		}}
		 maxarea=Math.max(maxarea, histogram(curr));
	}
	return maxarea;
}


	public static long min (long[] a){
		long min=Integer.MAX_VALUE;
		for(int i=0;i<n;i++){
			min=Math.min(min,a[i]);
		}
		return min;
	}
	
	
	public static void main(String[] args) throws Exception {
		
		Scanner sc=new Scanner(System.in);
		int t=Integer.parseInt(sc.nextLine());
		while(t-->0){
			n=Integer.parseInt(sc.nextLine());
			char[] inp=sc.nextLine().toCharArray();
			int [] res=new int[n];
			
			int num0=0;
			int num1=0;
			Stack <Integer> n0=new Stack<Integer>();
			Stack <Integer> n1=new Stack<Integer>();
			if(inp[0]=='0'){
				num0++;
				n0.push(num0);
			}
			else{
				num1++;
				n1.push(num1);
			}
			res[0]=1;
			int max=1;
			for(int i=1;i<inp.length;i++){
				if(inp[i]=='1'&&!n0.isEmpty()){
					num1=n0.pop();
				n1.push(num1);
				res[i]=num1;
					
					
				}
				else if(inp[i]=='0'&&!n1.isEmpty()){
					num0=n1.pop();
					n0.push(num0);
				res[i]=num0;
					
				}
				else if(inp[i]=='1'){
					num1=max+1;
					n1.push(num1);
					res[i]=num1;
					
			
				}
				else{
					num0=max+1;
					n0.push(num0);
					res[i]=num0;
				
				}
			max=Math.max(max, res[i]);	
				
			
			
			}
			System.out.println(max);
			for(int i=0;i<n;i++){
				System.out.print(res[i]+" ");
			}
			System.out.println();
		}
		}
	   	 	


	static class Scanner {
		StringTokenizer st;
		BufferedReader br;
 
		public Scanner(InputStream s) {
			br = new BufferedReader(new InputStreamReader(s));
		}
 
		public boolean hasNext() {
			// TODO Auto-generated method stub
			return false;
		}
 
		public String next() throws IOException {
			while (st == null || !st.hasMoreTokens())
				st = new StringTokenizer(br.readLine());
			return st.nextToken();
		}
 
		public int nextInt() throws IOException {
			return Integer.parseInt(next());
		}
 
		public long nextLong() throws IOException {
			return Long.parseLong(next());
		}
 
		public String nextLine() throws IOException {
			return br.readLine();
		}
 
		public double nextDouble() throws IOException {
			String x = next();
			StringBuilder sb = new StringBuilder("0");
			double res = 0, f = 1;
			boolean dec = false, neg = false;
			int start = 0;
			if (x.charAt(0) == '-') {
				neg = true;
				start++;
			}
			for (int i = start; i < x.length(); i++)
				if (x.charAt(i) == '.') {
					res = Long.parseLong(sb.toString());
					sb = new StringBuilder("0");
					dec = true;
				} else {
					sb.append(x.charAt(i));
					if (dec)
						f *= 10;
				}
			res += Long.parseLong(sb.toString()) / f;
			return res * (neg ? -1 : 1);
		}
 
		public boolean ready() throws IOException {
			return br.ready();
		}
 
	}}