#include <bits/stdc++.h>
using namespace std;
char a[200006], b[200006];
int n;
int cnt[2];
vector<int> vec[2];
int main() {
  scanf("%d%s%s", &n, a + 1, b + 1);
  for (int i = 1; i <= n; i++) {
    if (a[i] == b[i]) continue;
    vec[a[i] - 'a'].push_back(i);
  }
  if ((vec[0].size() + vec[1].size()) % 2 == 1) {
    printf("-1");
    return 0;
  }
  int ans = ((int)vec[0].size() + (int)vec[1].size()) / 2;
  if (vec[0].size() % 2 == 1) ans++;
  printf("%d\n", ans);
  if (vec[0].size() % 2 == 1) {
    int siz = (int)vec[0].size() - 1;
    printf("%d %d\n", vec[0][siz], vec[0][siz]);
    vec[1].push_back(vec[0][siz]);
    vec[0].pop_back();
  }
  for (int i = 0; i < 2; i++) {
    int siz = (int)vec[i].size();
    for (int j = 0; j < siz; j += 2)
      printf("%d %d\n", vec[i][j], vec[i][j + 1]);
  }
  return 0;
}
