#include <bits/stdc++.h>
using namespace std;
void solve() {
  int n;
  string s, t;
  cin >> n >> s >> t;
  vector<int> difa;
  vector<int> difb;
  for (int i = 0; i < n; i++) {
    if (s[i] != t[i]) {
      if (s[i] == 'a')
        difa.push_back(i + 1);
      else
        difb.push_back(i + 1);
    }
  }
  if (difa.size() == 0 && difb.size() == 0)
    cout << 0;
  else if ((difa.size() + difb.size()) % 2 == 1)
    cout << "-1";
  else {
    int i = 0, j = 0, c = 0;
    if (difa.size() % 2 == 0)
      cout << (difa.size() + difb.size()) / 2 << endl;
    else
      cout << (difa.size() + difb.size()) / 2 + 1 << endl;
    while (i < (int)difa.size() - 1 || j < (int)difb.size() - 1) {
      if (i < (int)difa.size() - 1) {
        cout << difa[i] << " " << difa[i + 1] << endl;
        i += 2;
      }
      if (j < (int)difb.size() - 1) {
        cout << difb[j] << " " << difb[j + 1] << endl;
        j += 2;
      }
    }
    if (i == (int)difa.size() - 1) {
      cout << difa[i] << " " << difa[i] << endl;
      cout << difa[i] << " " << difb[j] << endl;
    }
  }
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int q = 1;
  for (int kase = 1; kase <= q; kase++) {
    solve();
  }
  return 0;
}
