#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
template <class T>
istream& operator>>(istream& is, vector<T>& vec) {
  for (int i = 0; i < vec.size(); ++i) is >> vec[i];
  return is;
}
template <class T>
ostream& operator<<(ostream& os, vector<T>& vec) {
  for (auto& t : vec) os << t << " ";
  return os;
}
void st() {
  int n;
  string s;
  cin >> n >> s;
  for (int i = 0; i < n; ++i) {
    if (s[i] == '0') {
      if (i < n / 2) {
        cout << i + 1 << " " << n << " " << i + 2 << " " << n << (char)10;
      } else {
        cout << 1 << " " << i + 1 << " " << 1 << " " << i << (char)10;
      }
      return;
    }
  }
  cout << "1 " << n - (n % 2) << " 1 " << n / 2 << (char)10;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int t;
  cin >> t;
  for (int i = 0; i < t; ++i) {
    if (t < 50) {
      cerr << "-------------------" << (char)10;
    }
    st();
  }
}
