description: You are given a string s, consisting of n letters, each letter is either 'a' or 'b'. The letters in the string are numbered from 1 to n.
  
  s[l; r] is a continuous substring of letters from index l to r of the string inclusive. 
  
  A string is called balanced if the number of letters 'a' in it is equal to the number of letters 'b'. For example, strings "baba" and "aabbab" are balanced and strings "aaab" and "b" are not.
  
  Find any non-empty balanced substring s[l; r] of string s. Print its l and r (1 ≤ l ≤ r ≤ n). If there is no such substring, then print -1 -1.
  
  Input
  
  The first line contains a single integer t (1 ≤ t ≤ 1000) — the number of testcases.
  
  Then the descriptions of t testcases follow.
  
  The first line of the testcase contains a single integer n (1 ≤ n ≤ 50) — the length of the string.
  
  The second line of the testcase contains a string s, consisting of n letters, each letter is either 'a' or 'b'.
  
  Output
  
  For each testcase print two integers. If there exists a non-empty balanced substring s[l; r], then print l r (1 ≤ l ≤ r ≤ n). Otherwise, print -1 -1.
  
  Example
  
  Input
  
  
  4
  1
  a
  6
  abbaba
  6
  abbaba
  9
  babbabbaa
  
  
  Output
  
  
  -1 -1
  1 6
  3 6
  2 5
  
  Note
  
  In the first testcase there are no non-empty balanced subtrings.
  
  In the second and third testcases there are multiple balanced substrings, including the entire string "abbaba" and substring "baba".
solution: // HOPE
  
  ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  //----------------------------------------------------------------------------------------------------------------------
  ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  //----------------------------------------------------------------------------------------------------------------------
  ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  ///////                                                                                                       //////////
  ///////                                                                                                       //////////
  ///////            RRRRRRRRRRRRR     YY          YY         AA               NN         NN                    //////////
  ///////            RR         RR      YY        YY        AA  AA             NN NN      NN                    //////////
  ///////            RR        RR         YY     YY        AA    AA            NN  NN     NN                    //////////
  ///////            RRRRRRRRRR            YY   YY       AAAAAAAAAAAA          NN    NN   NN                    //////////
  ///////            RR RR                   YY         AAAAAAAAAAAAAA         NN      NN NN                    //////////
  ///////            RR   RR                 YY        AA            AA        NN       NNNN                    //////////
  ///////            RR     RR               YY       AA              AA       NN         NN                    //////////
  ///////            RR       RR_____________________________________________________________________________   //////////
  ////////                                                                                                      //////////
  ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  //----------------------------------------------------------------------------------------------------------------------
  ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  //----------------------------------------------------------------------------------------------------------------------
  ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  
  import java.io.BufferedReader;
  import java.io.IOException;
  import java.io.InputStreamReader;
  import java.io.PrintWriter;
  import java.util.*;
  
  public class Codeforces1 {
      static PrintWriter out = new PrintWriter(System.out);
      static final int mod=1_000_000_007;
  
      static class FastReader {
          BufferedReader br;
          StringTokenizer st;
  
          public FastReader() {
              br = new BufferedReader(new
                      InputStreamReader(System.in));
          }
  
          String next() {
              while (st == null || !st.hasMoreElements()) {
                  try {
                      st = new StringTokenizer(br.readLine());
                  } catch (IOException e) {
                      e.printStackTrace();
                  }
              }
              return st.nextToken();
          }
  
          int nextInt() {
              return Integer.parseInt(next());
          }
  
          int[] readArray(int n){
              int[] a = new int[n];
              for(int i=0;i<n;i++)
              a[i] = nextInt();
              return a;
          }
  
          long nextLong() {
              return Long.parseLong(next());
          }
  
          double nextDouble() {
              return Double.parseDouble(next());
          }
  
          String nextLine() {
              String str = "";
              try {
                  str = br.readLine();
              } catch (IOException e) {
                  e.printStackTrace();
              }
              return str;
          }
      }
  
  
      public static void main(String[] args) {
          FastReader s = new FastReader();
             int t = s.nextInt();
             while(t-->0)
             {
               int n  = s.nextInt();
               String str = s.nextLine();
               find(n, str);
             }
  
  
             out.close();
          }
  
          public static void find(int n, String str)
          {
              if(n==1)
              {
                  out.println("-1 -1");
                  return ;
              }
  
              int x = 0, y = 0;
              int valid = 0;
              for(int i=0;i<n;i++)
              {
                  x = 0; y = 0;
                  if(str.charAt(i)=='a')
                      x++;
                  else
                      y++;
                  for(int j=i+1;j<n;j++)
                  {
                      if(str.charAt(j)=='a')
                          x++;
                      else
                          y++;
  
                      if(x==y)
                      {
                          out.println((i+1)+" "+(j+1));
                          i = n;
                          valid = 1;
                          break;
                      }
                  }
              }
              if(valid == 0)
              {
                  out.println("-1 -1");
              }
          }
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
      /////////////////////////////////////////////////THE END///////////////////////////////////////////////////////////
      //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  
      public static int gcd(int x,int y)
      {
          return y==0?x:gcd(y,x%y);
      }
      public static long gcd(long x,long y)
      {
          return y==0L?x:gcd(y,x%y);
      }
  
      public static int lcm(int a, int b) {
          return (a * b) / gcd(a, b);
      }
      public static long lcm(long a, long b) {
          return (a * b) / gcd(a, b);
      }
  
      public static long pow(long a,long b)
      {
          if(b==0L)
              return 1L;
          long tmp=1;
          while(b>1L)
          {
              if((b&1L)==1)
                  tmp*=a;
              a*=a;
              b>>=1;
          }
          return (tmp*a);
      }
  
      public static long modPow(long a,long b,long mod)
      {
          if(b==0L)
              return 1L;
          long tmp=1;
          while(b>1L)
          {
              if((b&1L)==1L)
                  tmp*=a;
  
              a*=a;
              a%=mod;
              tmp%=mod;
              b>>=1;
          }
          return (tmp*a)%mod;
      }
  
      static long mul(long a, long b) {
          return a*b%mod;
      }
  
      static long fact(int n) {
          long ans=1;
          for (int i=2; i<=n; i++) ans=mul(ans, i);
          return ans;
      }
  
      static long fastPow(long base, long exp) {
          if (exp==0) return 1;
          long half=fastPow(base, exp/2);
          if (exp%2==0) return mul(half, half);
          return mul(half, mul(half, base));
      }
  
      static void debug(int ...a)
      {
          for(int x: a)
              System.out.print(x+" ");
          System.out.println();
      }
  
      static void debug(long ...a)
      {
          for(long x: a)
              System.out.print(x+" ");
          System.out.println();
      }
  
      static void debugMatrix(int[][] a)
      {
          for(int[] x:a)
              System.out.println(Arrays.toString(x));
      }
      static void debugMatrix(long[][] a)
      {
          for(long[] x:a)
              System.out.println(Arrays.toString(x));
      }
  
      static void reverseArray(int[] a) {
          int n = a.length;
          int[] arr = new int[n];
          for (int i = 0; i < n; i++)
              arr[i] = a[n - i - 1];
          for (int i = 0; i < n; i++)
              a[i] = arr[i];
      }
  
      static void reverseArray(long[] a) {
          int n = a.length;
          long[] arr = new long[n];
          for (int i = 0; i < n; i++)
              arr[i] = a[n - i - 1];
          for (int i = 0; i < n; i++)
              a[i] = arr[i];
      }
  
      static class Pair{
          int x, y;
          Pair(int x, int y)
          {
              this.x = x;
              this.y = y;
          }
  
          @Override
          public String toString() {
              return "Pair{" +
                      "x=" + x +
                      ", y=" + y +
                      '}';
          }
      }
      static class MyCmp implements Comparator<Pair>
      {
          public int compare(Pair p1, Pair p2)
          {
              return p1.x-p2.x;
          }
      }
  }
  