#include <bits/stdc++.h>
using namespace std;
int main() {
  int a[200001], b[200001], t, m, n, i, j, x;
  char d[200001];
  while (cin >> t)
    while (t--) {
      cin >> n >> d;
      if (n > 1) {
        m = j = 0;
        for (i = 0; i < n; i++) {
          a[i] = d[i] - '0';
          b[i] = 0;
        }
        sort(a, a + n);
        for (x = 1; x <= 2; x++)
          for (i = 0; i < n && j < n; i++)
            if (a[j] == d[i] - '0' && b[i] == 0) {
              b[i] = x;
              j++;
              m++;
            }
        if (m == n)
          for (i = 0; i < n; i++) cout << b[i];
        else
          cout << "-";
      } else
        cout << "1";
      cout << '\n';
    }
  return 0;
}
