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

public class first{
	PrintWriter out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));
    BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
    StringTokenizer tok;
    
    public static boolean valid(long x,long y,int n,int m)
    {
    	return x>=0 && y>=0 && x<n && y<m;
    }
    
    public static ArrayList<Integer> rec(int pre[],int i,int j, ArrayList<Integer> a,int m)
    {
    	if(m==1)
    	{
    		ArrayList<Integer> ans=new ArrayList<>();
    		
    	}
    	return null;
    }
    public void go() throws IOException
    {   
    	String test =  in.readLine();
    	if(test==null || test.trim().length()==0 )
    		return ;
    	
    	 tok = new StringTokenizer(test);
    	
       int tt = Integer.parseInt(tok.nextToken());
    	 //ntok();

    	for (int q = 0; q < tt; q++) {
		 ntok();
		int n=ipar();
		ntok();
		char a[]=spar().toCharArray();
		int sum=0;
		int i=0,j=0;
		/*TreeMap<Integer,Integer> z=new TreeMap<>();
		TreeMap<Integer,Integer> o=new TreeMap<>();*/
         LinkedList<Integer> z=new LinkedList<>();
         LinkedList<Integer> o=new LinkedList<>();
         
		if(n==1)
			{System.out.println(1);
			 System.out.println(1);
			 continue;
			}
		
		int ans[]=new int[n];
		int k=0;
		while(j<n)
		{  if(a[j]=='0')
			{
			  if(o.size()>0)
			  {
				  ans[j]=o.pollLast();
				  z.add(ans[j]);
			  }
			  else
			  {
				  k++;
				  ans[j]=k;
				  z.add(k);
			  }
			}
		else
		{
			if(z.size()>0)
			  {
				  ans[j]=z.pollLast();
				  o.add(ans[j]);
			  }
			  else
			  {
				  k++;
				  ans[j]=k;
				  o.add(k);
			  }
		}
			
		 
		  j++;
		}
		System.out.println(k);
		for(int l=0;l<n;l++)
			System.out.print(ans[l]+" ");
		
		System.out.println();
		
    	} 
 
        out.flush();
        in.close();
        
    }
 
    public void ntok() throws IOException
    {  String test =  in.readLine();
	if(test==null || test.trim().length()==0 )
		return ;
        tok = new StringTokenizer(test);
    }
 
    public int ipar()
    {   String test=tok.nextToken();
      if(test==null || test.trim().length()==0) 
    	  return 0;
      
        return Integer.parseInt(test);
    }
 
    public int[] iapar(int n)
    {
        int[] arr = new int[n];
        for (int i = 0; i < n; i++)
        {
            arr[i] = ipar();
        }
        return arr;
    }
 
    public long lpar()
    { String test=tok.nextToken();
      if(test==null || test.trim().length()==0) 
    	  return 0;
        return Long.parseLong(test);
    }
 
    public long[] lapar(int n)
    {
        long[] arr = new long[n];
        for (int i = 0; i < n; i++)
        {
            arr[i] = lpar();
        }
        return arr;
    }
 
    public double dpar()
    {
        return Double.parseDouble(tok.nextToken());
    }
 
    public String spar()
    { String test=tok.nextToken();
      if(test==null || test.trim().length()==0) 
    	  return "";
        return test;
    }
 
    public static void main(String[] args) throws java.lang.Exception
    {
        new first().go();
    }
    
    static class pair {
    	long f;long s;
    	public pair(long a,long b)
    	{
    		f=a;s=b;
    	}
    }

}