description: Frodo was caught by Saruman. He tore a pouch from Frodo's neck, shook out its contents —there was a pile of different rings: gold and silver...
  
  "How am I to tell which is the One?!" the mage howled.
  
  "Throw them one by one into the Cracks of Doom and watch when Mordor falls!" 
  
  Somewhere in a parallel Middle-earth, when Saruman caught Frodo, he only found n rings. And the i-th ring was either gold or silver. For convenience Saruman wrote down a binary string s of n characters, where the i-th character was 0 if the i-th ring was gold, and 1 if it was silver.
  
  Saruman has a magic function f, which takes a binary string and returns a number obtained by converting the string into a binary number and then converting the binary number into a decimal number. For example, f(001010) = 10, f(111) = 7, f(11011101) = 221.
  
  Saruman, however, thinks that the order of the rings plays some important role. He wants to find 2 pairs of integers (l_1, r_1), (l_2, r_2), such that:
  
    * 1 ≤ l_1 ≤ n, 1 ≤ r_1 ≤ n, r_1-l_1+1≥ ⌊ n/2 ⌋ 
    * 1 ≤ l_2 ≤ n, 1 ≤ r_2 ≤ n, r_2-l_2+1≥ ⌊ n/2 ⌋ 
    * Pairs (l_1, r_1) and (l_2, r_2) are distinct. That is, at least one of l_1 ≠ l_2 and r_1 ≠ r_2 must hold.
    * Let t be the substring s[l_1:r_1] of s, and w be the substring s[l_2:r_2] of s. Then there exists non-negative integer k, such that f(t) = f(w) ⋅ k.
  
  
  
  Here substring s[l:r] denotes s_ls_{l+1}… s_{r-1}s_r, and ⌊ x ⌋ denotes rounding the number down to the nearest integer.
  
  Help Saruman solve this problem! It is guaranteed that under the constraints of the problem at least one solution exists.
  
  Input
  
  Each test contains multiple test cases.
  
  The first line contains one positive integer t (1 ≤ t ≤ 10^3), denoting the number of test cases. Description of the test cases follows.
  
  The first line of each test case contains one positive integer n (2 ≤ n ≤ 2 ⋅ 10^4) — length of the string.
  
  The second line of each test case contains a non-empty binary string of length n.
  
  It is guaranteed that the sum of n over all test cases does not exceed 10^5.
  
  Output
  
  For every test case print four integers l_1, r_1, l_2, r_2, which denote the beginning of the first substring, the end of the first substring, the beginning of the second substring, and the end of the second substring, respectively.
  
  If there are multiple solutions, print any.
  
  Example
  
  Input
  
  
  7
  6
  101111
  9
  111000111
  8
  10000000
  5
  11011
  6
  001111
  3
  101
  30
  100000000000000100000000000000
  
  
  Output
  
  
  3 6 1 3
  1 9 4 9
  5 8 1 4
  1 5 3 5
  1 6 2 4
  1 2 2 3
  1 15 16 30
  
  Note
  
  In the first testcase f(t) = f(1111) = 15, f(w) = f(101) = 5.
  
  In the second testcase f(t) = f(111000111) = 455, f(w) = f(000111) = 7.
  
  In the third testcase f(t) = f(0000) = 0, f(w) = f(1000) = 8.
  
  In the fourth testcase f(t) = f(11011) = 27, f(w) = f(011) = 3.
  
  In the fifth testcase f(t) = f(001111) = 15, f(w) = f(011) = 3.
solution: import java.io.*;import java.lang.*;import java.util.*;
  //* --> number of prime numbers less then or equal to x are  -->  x/ln(x)
  //* --> String concatenation using the + operator within a loop should be avoided. Since the String object is immutable, each call for concatenation will
  // result in a new String object being created.
  // THE SIEVE USED HERE WILL RETURN A LIST CONTAINING ALL THE PRIME NUMBERS TILL N
   public class c {static FastScanner sc;static PrintWriter pw;static class FastScanner {InputStreamReader is;BufferedReader br;StringTokenizer st;
  public FastScanner() {is = new InputStreamReader(System.in);br = new BufferedReader(is);}
  String next() throws Exception {while (st == null || !st.hasMoreElements())st = new StringTokenizer(br.readLine());
  return st.nextToken();}int nextInt() throws Exception {return Integer.parseInt(next());}long nextLong() throws Exception {
  return Long.parseLong(next());}int[] readArray(int num) throws Exception {int arr[]=new int[num];
  for(int i=0;i<num;i++)arr[i]=nextInt();return arr;}String nextLine() throws Exception {return br.readLine();
  }} public static boolean power_of_two(int a){if((a&(a-1))==0){ return true;}return false;}
  static boolean PS(double x){if (x >= 0) {double i= Math.sqrt(x);if(i%1!=0){
  return false;}return ((i * i) == x);}return false;}public static int[] ia(int n){int ar[]=new int[n];
  return ar;}public static long[] la(int n){long ar[]=new long[n];return ar;}
  public static void print(int ans,int t){System.out.println("Case"+" "+"#"+t+":"+" "+ans);}
  static long mod=1000000007;static int max=Integer.MIN_VALUE;static int min=Integer.MAX_VALUE;
  public static void sort(long[] arr){//because Arrays.sort() uses quicksort which is dumb
  //Collections.sort() uses merge sort
  ArrayList<Long> ls = new ArrayList<Long>();for(long x: arr)ls.add(x);Collections.sort(ls);
  for(int i=0; i < arr.length; i++)arr[i] = ls.get(i);}public static long fciel(long a, long b) {if (a == 0)  return 0;return (a - 1) / b + 1;}
   static boolean[] is_prime = new boolean[1000001];static ArrayList<Integer> list = new ArrayList<>();
  static long n = 1000000;public static void sieve() {Arrays.fill(is_prime, true);
  is_prime[0] = is_prime[1] = false;for (int i = 2; i * i <= n; i++) {
  if (is_prime[i]) {for (int j = i * i; j <= n; j += i)is_prime[j] = false;}}for (int i = 2; i <= n; i++) {
  if (is_prime[i]) {list.add(i);}}}
  public static void main(String args[]) throws java.lang.Exception {
  sc = new FastScanner();pw = new PrintWriter(System.out);StringBuilder s = new StringBuilder();
  int t=sc.nextInt();
  while(t-->0)
  {
      int n=sc.nextInt();
      String str=sc.next();
      String check="";
      for(int i=0;i<n/2;i++){
          check+="0";
      }
      int f=0;
     for(int i=0;i<=n/2;i++)
     {
         if(str.substring(i,i+(n/2)).equals(check))
         {
             s.append((i+1)+" "+((i)+(n/2))+" "+1+" "+n);
             f=1;
             break;
         }
     }
     if(f==0)
     {
         for(int i=n/2;i<n;i++)
         {
             if(str.charAt(i)=='0')
             {
                 s.append(1+" "+(i+1)+" "+1+" "+i);
                 f=1;
                 break;
             }
         }
     }
     if( f==0)
     {
      if(str.charAt((n/2)-1)=='0')
      {
          s.append(n/2+" "+n+" "+((n/2)+1)+" "+n);
      }
      else{
          s.append(n/2+" "+(n-1)+" "+((n/2)+1)+" "+n);
      }
     }
      s.append("\n");
          }
  pw.print(s);pw.close();}
  }