#include <bits/stdc++.h>
using namespace std;
void solve(int z) {
  int n;
  cin >> n;
  string s;
  cin >> s;
  int least_length = n / 2;
  int search_range = ceil(n * 1.0 / 2) - 1;
  int zero_found = -1;
  for (int i = 0; i < n; i++) {
    if (s[i] == '0') {
      zero_found = i;
      break;
    }
  }
  if (zero_found > -1) {
    if (zero_found > search_range) {
      printf("%d %d %d %d", 1, zero_found + 1, 1, zero_found);
    } else {
      printf("%d %d %d %d", zero_found + 1, n, zero_found + 2, n);
    }
  } else {
    int first = 1;
    int second = n;
    printf("%d %d %d %d", first, second - 1, first + 1, second);
  }
  cout << endl;
}
int main() {
  int test_case;
  cin >> test_case;
  for (int k = 1; k <= test_case; k++) {
    solve(k);
  }
}
