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;
void vin(vector<int>& v) {
  int i, p;
  int n = (int)v.size();
  for (i = 0; i < n; i++) {
    scanf("%d", &v[i]);
  }
}
void vin(vector<long long>& v) {
  long long i, p;
  int n = v.size();
  for (i = 0; i < n; i++) {
    scanf("%lld", &v[i]);
  }
}
void vout(const vector<int>& v) {
  for (auto q : v) printf("%d ", q);
  printf("\n");
}
void vout(const vector<long long>& v) {
  for (auto q : v) printf("%lld ", q);
  printf("\n");
}
struct typ {
  int tp = -1;
  long long a = 0, b = 0;
};
struct comp {
  bool operator()(typ const& a, typ const& b) { return a.a < b.a; }
};
int main(int argc, char const* argv[]) {
  int t = 1;
  cin >> t;
  int co = 0;
  while (t--) {
    int n;
    cin >> n;
    string second;
    cin >> second;
    vector<string> v;
    int i = 0, j = 0, k = 0;
    vector<int> out(n);
    char cur = second[0];
    out[0] = 0;
    v.push_back(second[0] == '0' ? "0" : "1");
    set<int> Z, O;
    second[0] == '0' ? Z.insert(0) : O.insert(0);
    for (i = 1; i < n; i++) {
      cur = second[i];
      if (cur == '0') {
        if (O.empty()) {
          v.push_back("0");
          out[i] = (int)v.size() - 1;
          Z.insert((int)v.size() - 1);
        } else {
          int t = *O.begin();
          O.erase(O.begin());
          v[t] += cur;
          out[i] = t;
          Z.insert(t);
        }
      } else {
        if (Z.empty()) {
          v.push_back("1");
          out[i] = (int)v.size() - 1;
          O.insert((int)v.size() - 1);
        } else {
          int t = *Z.begin();
          Z.erase(Z.begin());
          v[t] += cur;
          O.insert(t);
          out[i] = t;
        }
      }
    }
    int l = (int)v.size();
    printf("%d\n", l);
    for (i = 0; i < n; i++) {
      printf("%d ", out[i] + 1);
    }
    printf("\n");
  }
  return 0;
}