// Cheese-Cracker: cheese-cracker.github.io

void theCode(){
    int n = scan!int;
    auto w = scan!(dchar[]);
    int l1, l2, r1, r2;
    for(int i = n/2; i < n; ++i){
        if(w[i] == '0'){
            l1 = 0;
            r1 = i;
            l2 = 0;
            r2 = i-1;
            writeln(l1+1, " ", r1+1, " ", l2+1, " ", r2+1);
            return;
        }
    }
    for(int i = 0; i < n/2; ++i){
        if(w[i] == '0'){
            l1 = i;
            r1 = n-1;
            l2 = i+1;
            r2 = n-1;
            writeln(l1+1, " ", r1+1, " ", l2+1, " ", r2+1);
            return;
        }
    }
    for(int i = 0; i < n; ++i){
        assert(w[i] == '1');
    }
    l1 = 0;
    r1 = n/2;
    l2 = 1;
    r2 = min(n/2 + 1, n-1);
    writeln(l1+1, " ", r1+1, " ", l2+1, " ", r2+1);
}

void main(){
    long tests = scan;        // Toggle!
    while(tests--) theCode();
}

/*********  That's All Folks!  *********/
import std.stdio, std.random, std.functional, std.container, std.algorithm;
import std.numeric, std.range, std.typecons, std.string, std.math, std.conv;
string[] tk; T scan(T=long)(){while(!tk.length)tk = readln.split; string a=tk.front; tk.popFront; return a.to!T;}
T[] scanArray(T=long)(){ auto r = readln.split.to!(T[]); return r; }
void show(A...)(A a){ debug{ foreach(t; a){stderr.write(t, "| ");} stderr.writeln; } }
alias ll = long, tup = Tuple!(long, "x",  long, "y");
