human
Write me a Python code to find 2 pairs of integers (l_1, r_1), (l_2, r_2), such that: given the following:
PYTHON3 solution for "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...":
assistant
#Here is Python code to find 2 pairs of integers (l_1, r_1), (l_2, r_2), such that:
.
 try:
    import sys
    from functools import lru_cache, cmp_to_key
    from heapq import merge, heapify, heappop, heappush
    from math import *
    from collections import defaultdict as dd, deque, Counter as C
    from itertools import combinations as comb, permutations as perm
    from bisect import bisect_left as bl, bisect_right as br, bisect, insort
    from time import perf_counter
    from fractions import Fraction
    import copy
    from copy import deepcopy
    import time
    starttime = time.time()
    mod = int(pow(10, 9) + 7)
    mod2 = 998244353

    def data(): return sys.stdin.readline().strip()
    def out(*var, end="\n"): sys.stdout.write(' '.join(map(str, var))+end)
    def L(): return list(sp())
    def sl(): return list(ssp())
    def sp(): return map(int, data().split())
    def ssp(): return map(str, data().split())
    def l1d(n, val=0): return [val for i in range(n)]
    def l2d(n, m, val=0): return [l1d(n, val) for j in range(m)]

    # sys.setrecursionlimit(int(pow(10,6)))
    # from sys import stdin
    # input = stdin.buffer.readline
    # I = lambda : list(map(int,input().split()))
    # import sys
    # input=sys.stdin.readline

    sys.stdin = open("input.txt", "r")
    sys.stdout = open("output.txt", "w")
except:
    pass

for _ in range(L()[0]):
    n=L()[0]
    s=input()
    if "0" in s:
        x=s.index("0")
        if x>=n//2:
            print(1,x+1,1,x)
            s="0"+s

            # print(int("0b"+(s[1:1+x+1]),2),int("0b"+(s[1:1+x]),2))
        else:
            print(x+2,x+n//2+1,x+1,x+n//2+1)
            s="0"+s

            # print(int("0b"+(s[x+2:1+x+n//2+1]),2),int("0b"+(s[x+1:1+x+n//2+1]),2))
    else:
        n-=n%2
        print(1,n,1,n//2)
        s="0"+s

        # print(int("0b"+(s[1:n+1]),2),int("0b"+(s[1:n//2+1]),2))