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.util.*;
import java.io.*;

 public class Task{
// taking inputs
static BufferedReader s1;
static BufferedWriter out;
static String read() throws IOException{String line="";while(line.length()==0){line=s1.readLine();continue;}return line;}
static int int_v (String s1){return Integer.parseInt(s1);}
static long long_v(String s1){return Long.parseLong(s1);}
static int[] int_arr() throws IOException{String[] a=read().split(" ");int[] b=new int[a.length];for(int i=0;i<a.length;i++){b[i]=int_v(a[i]);}return b;}
static long[] long_arr() throws IOException{String[] a=read().split(" ");long[] b=new long[a.length];for(int i=0;i<a.length;i++){b[i]=long_v(a[i]);}return b;}
static void assign(){s1=new BufferedReader(new InputStreamReader(System.in));out=new BufferedWriter(new OutputStreamWriter(System.out));}
static long Modpow(long a,long p,long m){long res=1;while(p>0){if((p&1)!=0){res=(res*a)%m;}p >>=1;a=(a*a)%m;}return res;}
static long Modmul(long a,long b,long m){return ((a%m)*(b%m))%m;}
static long ModInv(long a,long m){return Modpow(a,m-2,m);}
static int mod=(int)1e9+47;
//......................................@uthor_Alx..............................................

//if op<k l=m+1 else r=m
static class pair{
	long c;int idx;
	pair(long c1,int i){c=c1;idx=i;}
}
static int f11(pair p1,pair p2){
	if(p1.c>p2.c) return 1;
	return -1;
}
static int next(int f,Deque<Integer> d0,Deque<Integer> d1){
	if(f==0){
		if(!d0.isEmpty()){
			return d0.pollFirst();
		}
		else return -1;
	}
	else{
		if(!d1.isEmpty()){
			return d1.pollFirst();
		}
		else return -1;
	}

}
static void next1(int f,Deque<Integer> d0,Deque<Integer> d1,int tmp){
	if(f==0){
		d0.addFirst(tmp);
	}
	else{
		d1.addFirst(tmp);
	}

}
   public static void main(String[] args) throws  IOException{
				assign();
				int t=int_v(read()),cn=1;
				while(t--!=0){
					int[] z=int_arr();
					int n=z[0];//,k=z[1];
					char[] c=read().toCharArray();
					TreeSet<Integer> t0=new TreeSet<>();
					TreeSet<Integer> t1=new TreeSet<>();
					for(int i=0;i<n;i++){
						if(c[i]=='0'){
							t0.add(i);
						}
						else{
							t1.add(i);
						}

						//out.write(next0[i]+" "+next1[i]+"\n");
					}
					int[] b=new int[n]; int cc=1;
					for(int i=0;i<n;i++){
						if(b[i]>0) continue;
						if(c[i]=='0'){
							if(t1.isEmpty()){
								b[t0.pollFirst()]=cc;
								cc++;
							}
							else{
								int j=t0.pollFirst();
							b[j]=cc;
							Integer next=t1.higher(j); int f=1;
							while(next!=null){
								b[(int)next]=cc;
								if(f==1)t1.remove(next);
								else t0.remove(next);
								f^=1;
								if(f==0){
									next=t0.higher(next);
								}
								else{next=t1.higher(next);}
							}
							cc++;
							}
						}
						else{
							if(t0.isEmpty()){
								b[t1.pollFirst()]=cc;
								cc++;
							}
							else{
								int j=t1.pollFirst();
							b[j]=cc;
							Integer next=t0.higher(j); int f=0;
							while(next!=null){
								b[(int)next]=cc;
								if(f==1)t1.remove(next);
								else t0.remove(next);
								f^=1;
								if(f==0){
									next=t0.higher(next);
								}
								else{next=t1.higher(next);}
							}
							cc++;
							}
						}
					}
					cc--;
					out.write(cc+"\n");
					for(int zz:b){out.write(zz+" ");}
					out.write("\n");
				}
			    
			    out.flush();

	}
}