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 CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
template <class T>
inline bool read(T &x) {
  int c = getchar();
  int sgn = 1;
  while (~c && c < '0' || c > '9') {
    if (c == '-') sgn = -1;
    c = getchar();
  }
  for (x = 0; ~c && '0' <= c && c <= '9'; c = getchar()) x = x * 10 + c - '0';
  x *= sgn;
  return ~c;
}
inline long long int exp(long long int a, long long int p) {
  if (p == 0) return 1;
  long long int x = exp(a, p / 2) % 1000000007;
  x = (x * x) % 1000000007;
  if (p & 1) x = (x * (a % 1000000007)) % 1000000007;
  return x;
}
inline int add(int a, int b) {
  a += b;
  if (a >= 1000000007) a -= 1000000007;
  return a;
}
inline int sub(int a, int b) {
  a -= b;
  if (a < 1000000007) a += 1000000007;
  return a;
}
inline int multi(long long int a, long long int b) {
  a *= b;
  if (a >= 1000000007) a %= 1000000007;
  return a;
}
inline int on_bit(int N, int pos) { return N = N | (1 << pos); }
inline int off_bit(int N, int pos) { return N = N & ~(1 << pos); }
inline bool check_bit(long long int N, int pos) {
  return (bool)(N & (1 << pos));
}
int main() {
  int ___T;
  cin >> ___T;
  for (int cs = 1; cs <= ___T; cs++) {
    int n;
    cin >> n;
    string s;
    cin >> s;
    set<pair<int, int> > st;
    vector<string> v;
    vector<int> ans;
    for (int i = 0; i < n; i++) {
      if (v.size() == 0) {
        if (s[i] == '0') {
          st.insert({1, v.size()});
          ans.push_back((int)v.size() + 1);
          v.push_back("0");
        } else {
          st.insert({0, v.size()});
          ans.push_back((int)v.size() + 1);
          v.push_back("1");
        }
        continue;
      }
      if (s[i] == '0') {
        pair<int, int> pr = *st.begin();
        if (pr.first == 0) {
          st.erase(st.begin());
          pr.first = 1;
          st.insert(pr);
          v[pr.second].push_back('0');
          ans.push_back(pr.second + 1);
        } else {
          st.insert({1, v.size()});
          ans.push_back(v.size() + 1);
          v.push_back("0");
        }
      } else {
        pair<int, int> pr = *(--st.end());
        if (pr.first == 1) {
          st.erase(pr);
          pr.first = 0;
          st.insert(pr);
          v[pr.second].push_back('1');
          ans.push_back(pr.second + 1);
        } else {
          st.insert({0, v.size()});
          ans.push_back(v.size() + 1);
          v.push_back("1");
        }
      }
    }
    cout << v.size() << "\n";
    for (int i = 0; i < ans.size(); i++) {
      cout << ans[i];
      if (i != ans.size() - 1)
        cout << " ";
      else
        cout << "\n";
    };
  }
  return 0;
}