#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, ans;
  cin >> n;
  string s, t;
  cin >> s >> t;
  int ct1 = 0, ct2 = 0;
  vector<int> v1, v2;
  for (int i = 0; i < n; i++) {
    if (s[i] != t[i]) {
      if (s[i] == 'a') {
        ct1++;
        v1.push_back(i);
      } else {
        v2.push_back(i);
        ct2++;
      }
    }
  }
  if (ct1 % 2 && ct2 % 2) {
    ans = ct1 / 2 + ct2 / 2 + 2;
    cout << ans << endl;
    cout << v1[0] + 1 << " " << v1[0] + 1 << endl;
    cout << v1[0] + 1 << " " << v2[0] + 1 << endl;
    for (int i = 1; i < v1.size(); i += 2) {
      cout << v1[i] + 1 << " " << v1[i + 1] + 1 << endl;
    }
    for (int i = 1; i < v2.size(); i += 2) {
      cout << v2[i] + 1 << " " << v2[i + 1] + 1 << endl;
    }
  } else if (ct1 % 2 == 0 && ct2 % 2 == 0) {
    ans = (ct1 + ct2) / 2;
    cout << ans << endl;
    for (int i = 0; i < v1.size(); i += 2) {
      cout << v1[i] + 1 << " " << v1[i + 1] + 1 << endl;
    }
    for (int i = 0; i < v2.size(); i += 2) {
      cout << v2[i] + 1 << " " << v2[i + 1] + 1 << endl;
    }
  } else {
    cout << "-1";
  }
}
