#include <bits/stdc++.h>
using namespace std;
const long long A = 100000000000000LL, N = 100000;
char g;
string a, b;
vector<long long> p;
long long c[256][256], k, i, j, n, m;
int main() {
  cin >> n;
  cin >> a;
  cin >> b;
  for (i = 0; i < n; i++)
    if (a[i] != b[i]) c[(int)a[i]][(int)b[i]] = i + 1, p.push_back(i);
  m = p.size();
  for (i = 0; i < m; i++)
    if (c[(int)b[p[i]]][(int)a[p[i]]]) break;
  if (i < m)
    cout << p.size() - 2 << "\n";
  else if (i == m) {
    for (i = 0; i < m; i++) {
      k = 1;
      for (g = 'a'; g <= 'z'; g++)
        if (c[(int)g][(int)a[p[i]]]) {
          k = 0;
          break;
        }
      if (!k) break;
    }
    if (i == m)
      cout << p.size() << "\n";
    else {
      cout << p.size() - 1 << "\n"
           << p[i] + 1 << " " << c[(int)g][(int)a[p[i]]];
      return 0;
    }
  }
  if (i < m)
    cout << p[i] + 1 << " " << c[(int)b[p[i]]][(int)a[p[i]]];
  else if (p.size() < 2)
    cout << "-1 -1";
  else
    cout << p[0] + 1 << " " << p[1] + 1 << "\n";
}
