#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long n, c1 = 0, c2 = 0;
  cin >> n;
  string s;
  cin >> s;
  for (long long i = 0; i < n; i++) {
    if (s[i] == 'a') {
      c1++;
    } else {
      c2++;
    }
  }
  if (c1 == 0 || c2 == 0)
    cout << "-1 -1" << endl;
  else {
    for (long long i = 0; i < n - 1; i++) {
      if ((s[i] == 'a' and s[i + 1] == 'b') ||
          (s[i] == 'b' and s[i + 1] == 'a')) {
        cout << i + 1 << " " << i + 2 << endl;
        return;
      }
    }
  }
}
signed main() {
  long long t = 1;
  cin >> t;
  while (t--) {
    solve();
  }
}
