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.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.HashMap;

public class D_v3 {

	public static void main(String[] args) {
		FastScanner sc = new FastScanner();
	    PrintWriter out = new PrintWriter(new BufferedOutputStream(System.out));
	    
	    int t = sc.nextInt();
	    while(t-- > 0) {
	    	int n = sc.nextInt();
	    	String s = " " + sc.nextLine();
	    	
	    	// subsequences that end in zero so far
	    	ArrayList<ArrayList<Integer>> zero_lists = new ArrayList<>();
	    	ArrayList<ArrayList<Integer>> one_lists = new ArrayList<>();
	    	
	    	for(int i = 1; i <= n; i++) {
	    		if(s.charAt(i) == '0') {
	    			if(one_lists.size() == 0) {
	    				zero_lists.add(new ArrayList<Integer>());
	    				zero_lists.get(zero_lists.size() - 1).add(i);
	    			}else {
	    				one_lists.get(one_lists.size() - 1).add(i);
	    				zero_lists.add(one_lists.get(one_lists.size() - 1));
	    				// this should be O(1) - if not, use linked lists
	    				one_lists.remove(one_lists.size() - 1);
	    			}
	    		}else if(s.charAt(i) == '1'){
	    			if(zero_lists.size() == 0) {
	    				one_lists.add(new ArrayList<Integer>());
	    				one_lists.get(one_lists.size() - 1).add(i);
	    			}else {
	    				zero_lists.get(zero_lists.size() - 1).add(i);
	    				one_lists.add(zero_lists.get(zero_lists.size() - 1));
	    				// this should be O(1) - if not, use linked lists
	    				zero_lists.remove(zero_lists.size() - 1);
	    			}
	    		}
	    	}
	    	
	    	int[] index_groups = new int[n + 1];
	    	int group = 0;
	    	for(int i = 0; i < zero_lists.size(); i++) {
	    		group++;

	    		for(int index : zero_lists.get(i)) {
	    			index_groups[index] = group;
	    		}
	    	}
	    	for(int i = 0; i < one_lists.size(); i++) {
	    		group++;
	
	    		for(int index : one_lists.get(i)) {
	    			index_groups[index] = group;
	    		}
	    	}
	    	
	    	out.println(group);
 	    	for(int i = 1; i <= n; i++) {
 	    		out.print(index_groups[i] + " ");
 	    	}
 	    	out.println();
	    }
	    
	    out.close();
	}
	
	
	private static class FastScanner {
        private int BS = 1<<16;
        private char NC = (char)0;
        private byte[] buf = new byte[BS];
        private int bId = 0, size = 0;
        private char c = NC;
        private double cnt = 1;
        private BufferedInputStream in;
 
        public FastScanner() {
            in = new BufferedInputStream(System.in, BS);
        }
 
        public FastScanner(String s) {
            try {
                in = new BufferedInputStream(new FileInputStream(new File(s)), BS);
            }
            catch (Exception e) {
                in = new BufferedInputStream(System.in, BS);
            }
        }
 
        private char getChar(){
            while(bId==size) {
                try {
                    size = in.read(buf);
                }catch(Exception e) {
                    return NC;
                }
                if(size==-1)return NC;
                bId=0;
            }
            return (char)buf[bId++];
        }
 
        public int nextInt() {
            return (int)nextLong();
        }
 
        public int[] nextInts(int N) {
            int[] res = new int[N];
            for (int i = 0; i < N; i++) {
                res[i] = (int) nextLong();
            }
            return res;
        }
 
        public long[] nextLongs(int N) {
            long[] res = new long[N];
            for (int i = 0; i < N; i++) {
                res[i] = nextLong();
            }
            return res;
        }
 
        public long nextLong() {
            cnt=1;
            boolean neg = false;
            if(c==NC)c=getChar();
            for(;(c<'0' || c>'9'); c = getChar()) {
                if(c=='-')neg=true;
            }
            long res = 0;
            for(; c>='0' && c <='9'; c=getChar()) {
                res = (res<<3)+(res<<1)+c-'0';
                cnt*=10;
            }
            return neg?-res:res;
        }
 
        public double nextDouble() {
            double cur = nextLong();
            return c!='.' ? cur:cur+nextLong()/cnt;
        }
 
        public String next() {
            StringBuilder res = new StringBuilder();
            while(c<=32)c=getChar();
            while(c>32) {
                res.append(c);
                c=getChar();
            }
            return res.toString();
        }
 
        public String nextLine() {
            StringBuilder res = new StringBuilder();
            while(c<=32)c=getChar();
            while(c!='\n') {
                res.append(c);
                c=getChar();
            }
            return res.toString();
        }
 
        public boolean hasNext() {
            if(c>32)return true;
            while(true) {
                c=getChar();
                if(c==NC)return false;
                else if(c>32)return true;
            }
        }
    }
}

/*
if(curr_interval.to < curr_interval.from) {
	    				if(curr.below != null) {
	    					curr.below.next = curr.next;
	    					curr = curr.below;
	    				}else {
	    					if(curr == head) {
	    						head = curr.next;
	    					}else if(curr == tail) {
	    						prev.next = null;
	    					}else {
	    						if(prev.below == null) {
	    							prev.below = curr.next;
	    						}else {
	    							prev.bottom.below = curr.next;
	    						}
	    						
	    						if(curr.next.bottom == null)
	    							prev.bottom = curr.next;
	    						else
	    							prev.bottom = curr.next.bottom;
	    						
    							prev.next = curr.next.next;
	    					}
	    				}
	    				curr = curr.next.next;
	    			}else {
	    				prev = curr;
	    				curr = curr.next;
	    			}
	    */