#include <bits/stdc++.h>
using namespace std;
int t;
int main() {
  cin >> t;
  for (int i = 0; i < t; i++) {
    string s;
    int n, a[200010], b[200010];
    cin >> n;
    cin >> s;
    for (int j = 0; j < n; j++) {
      a[j] = int(s[j]) - 48;
      b[j] = a[j];
    }
    sort(b, b + n);
    int k = 0;
    for (int j = 0; j < n; j++) {
      if (b[k] == a[j]) {
        a[j] = 11;
        k++;
      }
    }
    for (int j = 0; j < n; j++) {
      if (b[k] == a[j]) {
        a[j] = 22;
        k++;
      }
    }
    if (k < n) {
      cout << "-";
    } else {
      for (int j = 0; j < n; j++) {
        if (a[j] == 11) {
          cout << 1;
        } else if (a[j] == 22) {
          cout << 2;
        }
      }
    }
    cout << endl;
  }
}
