#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long t;
  cin >> t;
  while (t--) {
    long long n;
    cin >> n;
    string s;
    cin >> s;
    long long br = 0;
    for (int i = n / 2, ggdem = n; i < ggdem; ++i) {
      if (s[i] == '0') {
        cout << 1 << " " << i + 1 << " " << 1 << " " << i << "\n";
        br++;
        break;
      }
    }
    if (br) continue;
    if (s[n / 2 - 1] == '0') {
      cout << n / 2 << " " << n << " " << n / 2 + 1 << " " << n << "\n";
    } else {
      cout << n / 2 << " " << n - 1 << " " << n / 2 + 1 << " " << n << "\n";
    }
  }
  return 0;
}
