#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    string s;
    cin >> s;
    bool yes = true;
    for (int i = 0; i < s.size() - 1; i++) {
      if (s[i] == 'a' && s[i + 1] == 'b') {
        cout << i + 1 << " " << i + 2 << endl;
        yes = false;
        break;
      } else if (s[i] == 'b' && s[i + 1] == 'a') {
        cout << i + 1 << " " << i + 2 << endl;
        yes = false;
        break;
      }
    }
    if (yes)
      cout << "-1"
           << " "
           << "-1" << endl;
  }
  return 0;
}
