#include <bits/stdc++.h>
using namespace std;
const int N = 3e5 + 7;
const int MOD = 1e9 + 7;
const int moveX[] = {-1, 0, 1, 0};
const int moveY[] = {0, 1, 0, -1};
const int INFI = 0x3f3f3f3f;
const long long INFL = 0x3f3f3f3f3f3f3f3fLL;
const double PI = acos(-1);
void Solve() {
  int n;
  string s;
  cin >> n;
  cin >> s;
  for (int i = 0; i < n; i++) {
    if (s[i] == '0') {
      if (i < n / 2) {
        cout << i + 1 << ' ' << n << ' ' << i + 2 << ' ' << n << endl;
      } else {
        cout << 1 << ' ' << i + 1 << ' ' << 1 << ' ' << i << endl;
      }
      return;
    }
  }
  cout << 1 << ' ' << (n / 2) * 2 << ' ' << 1 << ' ' << n / 2 << endl;
}
int main() {
  int TEST = 1;
  cin >> TEST;
  while (TEST--) {
    Solve();
  }
}
