#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 10;
char str[N], b[N];
int ans[N], t, n, f[N], cnt;
int main() {
  cin >> t;
  while (t--) {
    bool flag = 1;
    scanf("%d", &n);
    scanf("%s", str);
    for (int i = 0; i < n; i++) b[i] = str[i];
    sort(b, b + n);
    int pos = 0;
    int cnt = 0;
    for (int i = 0; i < n; i++) ans[i] = 2;
    for (int i = pos; i < n; i++)
      if (str[i] == b[pos]) {
        pos++;
        ans[i] = 1;
        f[++cnt] = str[i] - '0';
      }
    int last = 0;
    for (int i = 0; i < n; i++)
      if (ans[i] == 2) f[++cnt] = str[i] - '0';
    for (int i = 1; i < cnt; i++)
      if (f[i] > f[i + 1]) flag = 0;
    if (flag) {
      for (int i = 0; i < n; i++) printf("%d", ans[i]);
      printf("\n");
    } else
      printf("-\n");
  }
}
