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 Main {
///////----------------input----------------//////
	 static int p=31,m=1000000007;
	static BufferedReader br= new BufferedReader(new
            InputStreamReader(System.in)); 
	static BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));
	static StringTokenizer st; 
	static byte[] buffer =new byte[10*1024];
	static int index;
    static InputStream input_stream= System.in;
    static int total;
	
	static String ns() throws IOException
    { 
		 StringBuilder sb = new StringBuilder();
         int n = read();
         while (isWhiteSpace(n))
             n = read();
         while (!isWhiteSpace(n)) {
             sb.append((char)n);
             n = read();
         }
         return sb.toString();
    } 
	
	static int read() throws IOException
	{
		if(total<0)
            throw new InputMismatchException();
        if(index>=total) {
            index=0;
            total= input_stream.read(buffer);
            if(total<=0)
                return -1;
        }
        return buffer[index++];
	}
	static int ni() throws IOException
    { 
		int integer=0;
        int n= read();
        while(isWhiteSpace(n))
            n= read();
        int neg=1;
        if(n=='-') {
            neg=-1;
            n= read();
        }
        while(!isWhiteSpace(n)) {
            if(n>='0'&&n<='9') {
                integer*=10;
                integer+=n-'0';
                n= read();
            }
            else throw new InputMismatchException();
        }
        return neg*integer;
    } 
 
	static long nl() throws IOException
    { 
		long number=0;
        int n= read();
        while(isWhiteSpace(n))
            n= read();
        long neg=1l;
        if(n=='-') {
            neg=-1l;
            n= read();
        }
        while(!isWhiteSpace(n)) {
            if(n>='0'&&n<='9') {
                number*=10l;
                number+=(long)(n-'0');
                n= read();
            }
            else throw new InputMismatchException();
        }
        return neg*number;
    } 
 
	static double nd() throws IOException
    { 
		double doub=0;
        int n= read();
        while(isWhiteSpace(n))
            n= read();
        int neg=1;
        if(n=='-') {
            neg=-1;
            n= read();
        }
        while(!isWhiteSpace(n)&&n!='.') {
            if(n>='0'&&n<='9') {
                doub*=10;
                doub+=n-'0';
                n= read();
            }
            else throw new InputMismatchException();
        }
 
        if(n=='.') {
            n= read();
            double temp=1;
            while(!isWhiteSpace(n)) {
                if(n>='0'&&n<='9') {
                    temp/=10;
                    doub+=(n-'0')*temp;
                    n= read();
                }
                else throw new InputMismatchException();
            }
        }
        return doub*neg;
    } 
 
	static String nsl() throws IOException
    { 
        String str = ""; 
        try
        { 
            str = br.readLine(); 
        } 
        catch (IOException e) 
        { 
            e.printStackTrace(); 
        } 
        return str; 
    }
	static boolean isWhiteSpace(int n) {
        if(n==' '|| n=='\n'|| n=='\r'|| n=='\t'|| n==-1)
            return true;
        return false;
    }
	
	///////-------------output-----------------//////
	static public void p(String str) throws IOException {
        bw.append(str);
    }
	static public void pn(String str) throws IOException {
        p(str);
        bw.append("\n");
    }
	static public void close()throws IOException {
        bw.close();
    }
	static public void flush()throws IOException {
        bw.flush();
    }
	
	///////----------THE FAST I/O METHODS ENDS HERE -----------/////////////

	static int bit_score(int n) throws IOException  {
		  int a, b, c, largest, smallest;
		  int score;
 
		  a = n%10;  n/=10;
		  
		  b = n%10;  n/=10;
		  c = n%10;  n/=10;
 
		  largest = (a>b)?a:b;
		  largest = (c>largest)?c:largest;
		  smallest = (a<b)?a:b;
		  smallest = (c<smallest)?c:smallest;
 
		  score = largest*11 + smallest*7;
 
		  score = score % 100;
		  pn(score+"");
		  return score;
		}
	static int findPairs (int score_array[], int N) throws IOException  {
		  int sig_dig[]=new int[100];
		  int i, pairs = 0, msb;
 
		  for(i=0; i<10; i++)  {
		    sig_dig[i] = 0;
		  }
 
		  for(i=0; i<N; i=i+2)  {
		    msb = score_array[i] / 10;
		        for(int j =i+2; j<N; j=j+2){
		            if(msb == score_array[j]/10){
		                if(sig_dig[msb] < 2)  {
		              sig_dig[msb]++;
		            }
		            }
		        }
		    
		  }
		    
		    for(i=1; i<N; i=i+2)  {
		    msb = score_array[i] / 10;
		    for(int j =i+2; j<N; j=j+2){
		            if(msb == score_array[j]/10){
		                if(sig_dig[msb] < 2)  {
		              sig_dig[msb]++;
		            }
		            }
		        }
		  }
 
		  for(i=0; i<10; i++)  {
			  
				  
		    pairs = pairs + sig_dig[i];
		  }
 
		  return pairs;
		}
 
	static int al[]=new int[1100000];
	  public static void prime()throws IOException
	  {
	    int n=1000000;
	   
	    for(int i=2;i*i<=n;i++)
	    {
	      if(al[i]==0){
	      for(int j=i*i;j<=n;j+=i)
	      {
	        if(al[j]==0)
	    	  al[j]=i;
	        
	        
	      }
	       al[i]=i ;
	      }
	    }
	  
	  }
	  private static class Node {
	        public int i,j;

	        public Node(int i, int j) {
	            this.i = i;
	            this.j = j;
	        }
	    }
	  public static void main(String []args)
			  throws IOException{
	         Scanner s=new Scanner(System.in);
	       
	        	int t=ni();
	        	while(t-->0)
	        	{
	        		  int N = ni();
	                  String str = ns();
	                  int[] seq = new int[N];
	                  int end_one = 0;
	                  int end_zero = 0;
	                  LinkedList<Integer> zero = new LinkedList<>();
	                  LinkedList<Integer> one = new LinkedList<>();
	                  for (int i=0;i<N;i++) {
	                      if (str.charAt(i)=='1') {
	                          if (end_zero>0) {
	                              seq[i] = seq[zero.getLast()];
	                              end_zero--;
	                              end_one++;
	                              zero.removeLast();
	                              one.addLast(i);
	                          } else {
	                              end_one++;
	                              seq[i] = end_one;
	                              one.addLast(i);
	                          }
	                      } else {
	                          if (end_one>0) {
	                              seq[i] = seq[one.getLast()];
	                              end_one--;
	                              one.removeLast();
	                              end_zero++;
	                              zero.addLast(i);
	                          } else {
	                              end_zero++;
	                              seq[i] = end_zero;
	                              zero.addLast(i);
	                          }
	                      }
	                  }
	                  pn((end_one+end_zero+""));
	                  for (int i=0;i<N;i++) {
	                      pn(seq[i]+"");
	                      pn(" ");
	                  }
	                  pn("");
	        		
	        	}
	        	flush();
	        
	        }
	     

}