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;
namespace my_template {
vector<vector<long long>> primes;
vector<vector<long long>> facts;
vector<long long> factorialNumInverse;
vector<long long> naturalNumInverse;
vector<long long> factorials;
long long big = 1e9 + 7;
void InverseofNumber(long long N, long long p = big) {
  naturalNumInverse[0] = naturalNumInverse[1] = 1;
  for (long long i = 2; i <= N; i++)
    naturalNumInverse[i] = naturalNumInverse[p % i] * (p - p / i) % p;
}
void InverseofFactorial(long long N, long long p = big) {
  factorialNumInverse[0] = factorialNumInverse[1] = 1;
  for (long long i = 2; i <= N; i++)
    factorialNumInverse[i] =
        (naturalNumInverse[i] * factorialNumInverse[i - 1]) % p;
}
void factorial(long long N, long long p = big) {
  factorials[0] = 1;
  for (long long i = 1; i <= N; i++) {
    factorials[i] = (factorials[i - 1] * i) % p;
  }
}
void setncr(long long size = 1e5 + 1, long long p = big) {
  factorialNumInverse.resize(size);
  naturalNumInverse.resize(size);
  factorials.resize(size);
  InverseofNumber(size, p);
  factorial(size, p);
  InverseofFactorial(size, p);
}
long long ncr(long long N, long long R, long long p = big) {
  long long ans = ((factorials[N] * factorialNumInverse[R]) % p *
                   factorialNumInverse[N - R]) %
                  p;
  return ans;
}
long long power(long long a, long long b, long long m = big) {
  if (b == 0) return 1;
  long long ans = power(a, b / 2, m);
  if (b % 2 == 0) return ans * ans % m;
  return ((a * ans) % m * ans) % m;
}
long long inverse(long long a, long long m = big) { return power(a, m - 2, m); }
long long ceil(long long a, long long b) {
  if (a == 0) return 0;
  return (a - 1) / b + 1;
}
void init_prime(long long size = 1e6 + 1) {
  primes.resize(size);
  for (long long i = 2; i < size; i++) {
    if (primes[i].size() == 0) {
      for (long long j = i; j < size; j += i) primes[j].push_back(i);
    }
  }
}
void init_facts(long long size = 2e5 + 1) {
  facts.resize(size);
  for (long long i = 1; i < size; i++) {
    for (long long j = i; j < size; j += i) facts[j].push_back(i);
  }
}
long long gcd(long long a, long long b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
template <typename T>
vector<long long> argsort(const vector<T> &v, bool reverse = false) {
  vector<long long> idx(v.size());
  iota(idx.begin(), idx.end(), 0);
  if (reverse == false)
    stable_sort(idx.begin(), idx.end(),
                [&v](long long i1, long long i2) { return v[i1] < v[i2]; });
  else
    stable_sort(idx.begin(), idx.end(),
                [&v](long long i1, long long i2) { return v[i1] > v[i2]; });
  return idx;
}
}  // namespace my_template
using namespace my_template;
void solve();
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  init_facts(2e5 + 1);
  setncr(1e5 + 1);
  long long t = 1;
  cin >> t;
  while (t--) solve();
}
void solve() {
  long long n;
  cin >> n;
  string s;
  cin >> s;
  vector<long long> first, zero;
  vector<long long> ans;
  long long curr = 0;
  for (char c : s) {
    if (c == '0') {
      if (first.size() == 0) {
        curr++;
        ans.push_back(curr);
        zero.push_back(curr);
      } else {
        ans.push_back(first.back());
        zero.push_back(first.back());
        first.pop_back();
      }
    } else {
      if (zero.size() == 0) {
        curr++;
        ans.push_back(curr);
        first.push_back(curr);
      } else {
        ans.push_back(zero.back());
        first.push_back(zero.back());
        zero.pop_back();
      }
    }
  }
  cout << curr << endl;
  for (long long i : ans) cout << i << ' ';
  cout << endl;
}