#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n;
  cin >> n;
  string s1, s2;
  cin >> s1 >> s2;
  vector<long long int> v1(n);
  vector<vector<long long int>> v;
  long long int c = 0, p = 0, c1 = 0, p1 = 0, count = 0;
  for (long long int i = 0; i < n; i++) {
    if (s1[i] == s2[i])
      v1[i] = 0;
    else if (s1[i] == 'a') {
      v1[i] = 1;
      count++;
    } else {
      v1[i] = -1;
      count++;
    }
  }
  if (count % 2 != 0)
    cout << "-1" << endl;
  else {
    for (long long int i = 0; i < n; i++) {
      if (v1[i] == 1) {
        if (p == 0) {
          p = 1;
          p1 = i;
        } else {
          v.push_back({p1 + 1, i + 1});
          p = 0;
        }
      } else if (v1[i] == -1) {
        if (c == 0) {
          c = 1;
          c1 = i;
        } else {
          v.push_back({c1 + 1, i + 1});
          c = 0;
        }
      }
    }
    if ((c == 1) && (p == 1)) {
      v.push_back({p1 + 1, p1 + 1});
      v.push_back({p1 + 1, c1 + 1});
    }
    cout << v.size() << endl;
    for (long long int i = 0; i < v.size(); i++) {
      cout << v[i][0] << " " << v[i][1] << endl;
    }
  }
}
