#include <bits/stdc++.h>
using namespace std;
const long long maxn = 100010;
long long x;
void solve() {
  long long n;
  string s, s1, ans;
  cin >> n >> s;
  s1 = s;
  ans = s;
  sort((s1).begin(), (s1).end());
  long long id = 0;
  for (long long i = 0; i < n; i++) {
    if (s[i] == s1[id]) {
      id++;
      s[i] = 1;
      ans[i] = '1';
    }
  }
  for (long long i = 0; i < n; i++) {
    if (s[i] == s1[id]) {
      s[i] = 1;
      ans[i] = '2';
      id++;
    }
  }
  if (id != n) ans = "-";
  cout << ans << '\n';
}
signed main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long t = 1;
  cin >> t;
  while (t--) {
    solve();
  }
  return 0;
}
