#include <bits/stdc++.h>
using namespace std;
bool comp(pair<double, long long> a, pair<double, long long> b) {
  return a.first > b.first;
}
long long ex(long long n, long long ans) {
  if (n == 1)
    return ans;
  else if (n % 2)
    return (ans % ((1000000007)) * ex(n / 2, (ans * ans) % (1000000007))) %
           (1000000007);
  else
    return ex(n / 2, (ans * ans) % (1000000007));
}
long long kmp(string x, long long m) {
  vector<long long> pi(m, 0);
  pi[0] = 0;
  long long ma = 0;
  long long j = 0;
  for (long long i = 1; i < m; i++) {
    j = pi[i - 1];
    while (j > 0 && x[i] != x[j]) j = pi[j - 1];
    if (x[j] == x[i]) j++;
    pi[i] = j;
  }
  return j;
}
void dfs(vector<long long> adj[], long long arr[], long long co[],
         long long parent[], long long i, long long &cnt) {
  long long x = 1;
  arr[i] = 1;
  for (long long j = (0); j < (adj[i].size()); ++j) {
    if (arr[adj[i][j]] == 0) {
      if (co[adj[i][j]] != co[parent[adj[i][j]]]) cnt++;
      dfs(adj, arr, co, parent, adj[i][j], cnt);
    }
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  long long t = 1;
  while (t--) {
    long long n;
    cin >> n;
    string s, t;
    cin >> s >> t;
    vector<long long> x, y;
    for (long long i = (0); i < (n); ++i) {
      if (s[i] == 'a' && t[i] == 'b')
        x.push_back(i);
      else if (s[i] == 'b' && t[i] == 'a')
        y.push_back(i);
    }
    if (!(x.size() % 2 || y.size() % 2)) {
      cout << (x.size() + y.size()) / 2 << "\n";
      for (long long i = 0; i < x.size(); i += 2)
        cout << x[i] + 1 << " " << x[i + 1] + 1 << "\n";
      for (long long i = 0; i < y.size(); i += 2)
        cout << y[i] + 1 << " " << y[i + 1] + 1 << "\n";
    } else if (x.size() % 2 && y.size() % 2) {
      cout << (x.size() + y.size()) / 2 + 1 << "\n";
      for (long long i = 0; i < x.size() - 1; i += 2)
        cout << x[i] + 1 << " " << x[i + 1] + 1 << "\n";
      for (long long i = 0; i < y.size() - 1; i += 2)
        cout << y[i] + 1 << " " << y[i + 1] + 1 << "\n";
      cout << x[x.size() - 1] + 1 << " " << x[x.size() - 1] + 1 << "\n";
      cout << x[x.size() - 1] + 1 << " " << y[y.size() - 1] + 1;
    } else
      cout << "-1";
  }
}
