#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007;
const int inf = 0x3f3f3f3f;
const long long INF = 0x3f3f3f3f3f3f3f3f;
long long qpow(long long a, long long b) {
  long long s = 1;
  while (b > 0) {
    if (b % 2 == 1) {
      s = s * a;
    }
    a = a * a;
    b = b >> 1;
  }
  return s;
}
long long qpowmod(long long a, long long b, long long c) {
  long long res, t;
  res = 1;
  t = a % c;
  while (b) {
    if (b & 1) {
      res = res * t % c;
    }
    t = t * t % c;
    b >>= 1;
  }
  return res;
}
long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
long long lcm(long long a, long long b) { return a / gcd(a, b) * b; }
inline long long read() {
  long long k = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    k = k * 10 + ch - '0';
    ch = getchar();
  }
  return k * f;
}
inline void write(long long x) {
  if (x < 0) x = -x, putchar('-');
  if (x > 9) write(x / 10);
  putchar(x % 10 + '0');
}
int t;
int n, a[200005], b[200005], c[200005];
int main() {
  cin >> t;
  while (t--) {
    cin >> n;
    for (int i = 1; i <= n; i++) {
      char z;
      cin >> z;
      a[i] = z - '0';
      b[i] = a[i];
    }
    sort(b + 1, b + 1 + n);
    int l = 1, cnt = 1;
    while (1) {
      if (l > n || cnt > n) {
        break;
      }
      if (a[l] == b[cnt]) {
        c[l] = 1;
        cnt++;
      }
      l++;
    }
    l = 1;
    while (1) {
      if (l > n || cnt > n) {
        break;
      }
      if (a[l] == b[cnt] && c[l] == 0) {
        c[l] = 2;
        cnt++;
      }
      l++;
    }
    for (int i = 1; i <= n; i++) {
      if (c[i] == 0) {
        cout << '-' << "\n";
        goto s1;
      }
    }
    for (int i = 1; i <= n; i++) {
      cout << c[i];
    }
    cout << "\n";
  s1:;
    for (int i = 1; i <= n; i++) {
      c[i] = 0;
    }
  }
}
