#include <bits/stdc++.h>
using namespace std;
const int N = 3e5, M = N;
const long long infl = 0x3f3f3f3f3f3f3f3fLL;
const int infi = 0x3f3f3f3f;
void solve() {
  long long n;
  cin >> n;
  ;
  string s;
  cin >> s;
  bool c = false;
  for (long long i = 0; i < n + 1; i++) {
    if (s[i] < s[i + 1]) {
      cout << "YES" << endl;
      cout << i << " " << i + 1 << endl;
      c = true;
      break;
    }
  }
  if (!c) cout << "NO" << endl;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  ;
  long long tc;
  cin >> tc;
  while (tc--) {
    solve();
  }
  return 0;
}
