#include <bits/stdc++.h>
using namespace std;
void _print(long long t) { cerr << t; }
void _print(int t) { cerr << t; }
void _print(string t) { cerr << t; }
void _print(char t) { cerr << t; }
void _print(long double t) { cerr << t; }
void _print(double t) { cerr << t; }
void _print(unsigned long long t) { cerr << t; }
template <class T, class V>
void _print(pair<T, V> p);
template <class T>
void _print(vector<T> v);
template <class T>
void _print(set<T> v);
template <class T, class V>
void _print(map<T, V> v);
template <class T>
void _print(multiset<T> v);
template <class T, class V>
void _print(pair<T, V> p) {
  cerr << "{";
  _print(p.first);
  cerr << ",";
  _print(p.second);
  cerr << "}";
}
template <class T>
void _print(vector<T> v) {
  cerr << "[ ";
  for (T i : v) {
    _print(i);
    cerr << " ";
  }
  cerr << "]";
}
template <class T>
void _print(set<T> v) {
  cerr << "[ ";
  for (T i : v) {
    _print(i);
    cerr << " ";
  }
  cerr << "]";
}
template <class T>
void _print(multiset<T> v) {
  cerr << "[ ";
  for (T i : v) {
    _print(i);
    cerr << " ";
  }
  cerr << "]";
}
template <class T, class V>
void _print(map<T, V> v) {
  cerr << "[ ";
  for (auto i : v) {
    _print(i);
    cerr << " ";
  }
  cerr << "]";
}
int gcd(int a, int b) {
  if (b == 0)
    return a;
  else
    return gcd(b, a % b);
}
bool isprime(long long a) {
  if (a <= 1) return false;
  if (a == 2 || a == 3) return true;
  if (a % 2 == 0 || a % 3 == 0) return false;
  for (int i = 5; i * i <= a; i += 6) {
    if (a % i == 0 || a % (i + 2) == 0) return false;
  }
  return true;
}
void sieve(vector<bool> &isprimesieve) {
  isprimesieve[0] = isprimesieve[1] = false;
  for (int i = 2; i * i <= 1000000; i++) {
    if (isprimesieve[i]) {
      for (int j = i * i; j <= 1000000; j += i) {
        isprimesieve[j] = false;
      }
    }
  }
}
bool isperfectsq(long long a) { return (sqrt(a) - (int)sqrt(a) == 0); }
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int t = 0;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    string s;
    cin >> s;
    bool flag = false;
    for (int i = 0; i < n; i++) {
      if (s[i] == '0') {
        flag = true;
        if (i >= n / 2) {
          cout << 1 << " " << i + 1 << " " << 1 << " " << i << "\n";
          break;
        } else {
          cout << i + 1 << " " << n << " " << i + 2 << " " << n << "\n";
          break;
        }
      }
    }
    if (!flag) {
      cout << 1 << " " << n - 1 << " " << 2 << " " << n << "\n";
    }
  }
  return 0;
}
