#include <bits/stdc++.h>
using namespace std;
;
void AurBhaiKaisaHai() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  unordered_set<char> u(s.begin(), s.end());
  if (u.size() == 1) {
    cout << -1 << ' ' << -1;
    return;
  }
  if (s.find("ab") != string::npos)
    cout << s.find("ab") + 1 << ' ' << s.find("ab") + 2;
  else
    cout << s.find("ba") + 1 << ' ' << s.find("ba") + 2;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int t;
  cin >> t;
  while (t--) {
    AurBhaiKaisaHai();
    cout << "\n";
  }
}
