#include <bits/stdc++.h>
using namespace std;
double pi = acos(-1);
inline long long lowbit(long long x) { return x & (-x); }
inline long long min(long long a, long long b) { return a < b ? a : b; }
inline long long max(long long a, long long b) { return a > b ? a : b; }
const int INF = 0x3f3f3f3f, max_n = 200005, mod = 19260817;
inline long long gcd(long long a, long long b) {
  return b == 0 ? a : gcd(b, a % b);
}
inline long long pow(long long a, long long b, long long mod) {
  long long res = 1;
  a %= mod;
  assert(b >= 0);
  for (; b; b >>= 1) {
    if (b & 1) res = res * a % mod;
    a = a * a % mod;
  }
  return res;
}
string s, s1;
string ans1;
int ans[max_n];
int main() {
  int _;
  cin >> _;
  while (_--) {
    int n;
    cin >> n;
    cin >> s;
    s1 = s;
    sort(s1.begin(), s1.end());
    int j = 0;
    for (int i = 0; i < n && j < n;) {
      while (s[j] != s1[i]) {
        j++;
        if (j == n) goto a;
      }
      ans[j] = 1;
      ans1 += s[j];
      i++;
      j++;
    }
  a:;
    for (int i = 0; i < n; i++) {
      if (ans[i] == 0) {
        ans1 += s[i];
      }
    }
    if (is_sorted(ans1.begin(), ans1.end())) {
      for (int i = 0; i < n; i++) {
        if (ans[i] == 0) {
          cout << '2';
        } else {
          cout << '1';
        }
      }
      cout << '\n';
    } else {
      cout << "-" << '\n';
    }
    memset(ans, 0, sizeof(ans));
    ans1.clear();
  }
}
