#include <bits/stdc++.h>
using namespace std;
void minimize(long long int &a, long long int b) { a = std::min(a, b); }
void maximize(long long int &a, long long int b) { a = std::max(a, b); }
int main(int argc, const char *argv[]) {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int t = 1;
  long long int n;
  string s;
  cin >> t;
  while (t--) {
    cin >> n >> s;
    string temp = s;
    sort((temp).begin(), (temp).end());
    string ans;
    for (long long int i = 0; i < n; i++) {
      ans.push_back('X');
    }
    long long int x = 0;
    for (long long int i = 0; i < n; i++) {
      if (s[i] == temp[x]) {
        x++;
        s[i] = 'X';
        ans[i] = '1';
      }
    }
    for (long long int i = 0; i < n; i++) {
      if (s[i] == temp[x]) {
        x++;
        ans[i] = '2';
      }
    }
    if (x != n)
      cout << "-\n";
    else
      cout << ans << "\n";
  }
  return 0;
}
