#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ;
  long long int n;
  cin >> n;
  string s;
  cin >> s;
  string a = s;
  sort(a.begin(), a.end());
  int flag = 0;
  if (a == s)
    cout << "NO" << endl;
  else {
    int i;
    for (i = 1; i < n; i++) {
      if (a[0] == s[i]) break;
    }
    if (a[i] > s[i])
      cout << "1 " << i + 1 << endl;
    else
      cout << "2 " << i + 1 << endl;
  }
  return 0;
}
