#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int t;
  cin >> t;
  while (t--) {
    long long int n;
    cin >> n;
    string s;
    cin >> s;
    string k = s;
    sort(k.begin(), k.end());
    long long int color[n];
    for (long long int i = 0; i < n; i++) color[i] = 0;
    long long int temp = 0;
    for (long long int i = 0, j = 0; i < n && j < n; j++) {
      if (s[j] == k[i] && color[j] == 0) {
        color[j] = 1;
        i++;
        temp = i;
      }
    }
    for (long long int i = temp, j = 0; i < n && j < n; j++) {
      if (s[j] == k[i] && color[j] == 0) {
        color[j] = 2;
        i++;
      }
    }
    long long int check = 0;
    for (long long int i = 0; i < n; i++) {
      if (color[i] == 0) {
        check = 1;
        break;
      }
    }
    if (check == 0) {
      for (long long int i = 0; i < n; i++) cout << color[i];
      cout << "\n";
    } else if (check == 1)
      cout << "-\n";
  }
  return 0;
}
