#include <bits/stdc++.h>
using namespace std;
const int inf = 0x3f3f3f3f;
const int maxn = 20010;
char s[maxn];
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int t;
  cin >> t;
  while (t--) {
    int n;
    int l1, r1, l2, r2;
    cin >> n >> s;
    int nb[2];
    memset(nb, 0, sizeof nb);
    int mid = n / 2 - 1;
    for (int i = 0; i < n; i++) {
      nb[s[i] - 48]++;
    }
    if (nb[0] != 0 && nb[1] != 0) {
      for (int i = 0; i < n; i++) {
        if (s[i] - 48 == 0) {
          if (i <= mid) {
            l1 = i + 1;
            r1 = n;
            l2 = i + 2;
            r2 = n;
            break;
          } else {
            l1 = 1;
            r1 = i + 1;
            l2 = 1;
            r2 = i;
            break;
          }
        }
      }
    } else {
      l1 = 1;
      l2 = 2;
      r1 = n - 1;
      r2 = n;
    }
    cout << l1 << " " << r1 << " " << l2 << " " << r2 << endl;
  }
  return 0;
}
