#include <bits/stdc++.h>
using namespace std;
template <typename T1, typename T2>
istream& operator>>(istream& in, pair<T1, T2>& a) {
  in >> a.first >> a.second;
  return in;
}
template <typename T1, typename T2>
ostream& operator<<(ostream& out, pair<T1, T2> a) {
  out << a.first << " " << a.second;
  return out;
}
template <typename T, typename T1>
T amax(T& a, T1 b) {
  if (b > a) a = b;
  return a;
}
template <typename T, typename T1>
T amin(T& a, T1 b) {
  if (b < a) a = b;
  return a;
}
const long long INF = 1e18;
const int32_t M = 1e9 + 7;
const int32_t MM = 998244353;
priority_queue<pair<long long, long long>, vector<pair<long long, long long> >,
               greater<pair<long long, long long> > >
    q;
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long t;
  cin >> t;
  while (t--) {
    long long n;
    string s, s1;
    cin >> n;
    cin >> s;
    s1 = s;
    sort((s1).begin(), (s1).end());
    long long ans[n + 1];
    memset(ans, -1, sizeof(ans));
    long long j = 0;
    for (long long i = 0; i < n; i++) {
      if (s[i] == s1[j]) {
        ans[i] = 1;
        j++;
      }
    }
    for (long long i = 0; i < n; i++) {
      if (s[i] == s1[j] && ans[i] == -1) {
        ans[i] = 2;
        j++;
      }
    }
    if (j != n) {
      cout << '-' << endl;
    } else {
      for (long long i = 0; i < n; i++) cout << ans[i];
      cout << endl;
    }
  }
}
