#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 11;
char S[N], T[N];
struct Diff {
  int id;
  char a, b;
  Diff() {}
  Diff(int i, char _a, char _b) : id(i), a(_a), b(_b) {}
  bool operator<(const Diff t) const { return a < t.a; }
} diff[2 * N];
int main() {
  int n;
  while (1 == scanf("%d", &n)) {
    scanf("%s%s", S + 1, T + 1);
    int cnt = 0;
    for (int i = 1; i <= n; i++) {
      if (S[i] ^ T[i]) {
        diff[cnt++] = Diff(2 * i, S[i], T[i]);
        diff[cnt++] = Diff(2 * i + 1, T[i], S[i]);
      }
    }
    sort(diff, diff + cnt);
    for (int i = 0; i < cnt; i++) {
    }
    int ans_1 = 0, ans_2 = 0, l1, r1, l2, r2;
    Diff last = diff[0];
    for (int i = 1; i < cnt; i++) {
      if (diff[i].a == last.a) {
        if ((diff[i].id ^ last.id) & 1) {
          if (diff[i].b == last.b) {
            ans_2 = 1;
            l2 = last.id / 2;
            r2 = diff[i].id / 2;
          } else {
            ans_1 = 1;
            l1 = last.id / 2;
            r1 = diff[i].id / 2;
          }
        }
      } else {
        last = diff[i];
      }
    }
    if (ans_2)
      printf("%d\n%d %d\n", cnt / 2 - 2, l2, r2);
    else if (ans_1)
      printf("%d\n%d %d\n", cnt / 2 - 1, l1, r1);
    else
      printf("%d\n-1 -1\n", cnt / 2);
  }
  return 0;
}
