#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n, flag = -1;
    cin >> n;
    string s;
    cin >> s;
    for (int i = 0; i < n - 1; i++) {
      if (s[i] == 'a' && s[i + 1] == 'b') {
        cout << i + 1 << " " << i + 2;
        flag = 0;
        break;
      }
      if (s[i] == 'b' && s[i + 1] == 'a') {
        cout << i + 1 << " " << i + 2;
        flag = 0;
        break;
      }
    }
    if (flag == -1) cout << flag << " " << flag;
    cout << "\n";
  }
  return 0;
}
