#include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 7;
int n, tot, s[N], ch[N][26], len[N], fa[N], tran[N], d[N];
char S[N];
pair<int, int> f[N], g[N];
int extend(int n, int p, char c) {
  int idx = c - 'a';
  while (s[n - len[p] - 1] != c) p = fa[p];
  if (!ch[p][idx]) {
    int q = ++tot, t = fa[p];
    len[q] = len[p] + 2;
    while (s[n - len[t] - 1] != c) t = fa[t];
    fa[q] = ch[t][idx], ch[p][idx] = q, d[q] = len[q] - len[fa[q]];
    tran[q] = d[q] == d[fa[q]] ? tran[fa[q]] : fa[q];
  }
  return ch[p][idx];
}
int main() {
  fa[0] = tot = 1, len[1] = -1;
  scanf("%s", S + 1), n = strlen(S + 1);
  for (int i = 1; i <= n; i++) s[(i << 1) - 1] = S[i];
  scanf("%s", S + 1);
  for (int i = 1; i <= n; i++) s[i << 1] = S[i];
  n = n << 1;
  int st = 0;
  for (int i = 1; i <= n; i++) {
    f[i] = make_pair(1e9, -1);
    st = extend(i, st, s[i]);
    for (int p = st; p; p = tran[p]) {
      int lst = i - len[tran[p]] - d[p];
      g[p] = make_pair(f[lst].first, lst);
      if (d[fa[p]] == d[p]) g[p] = min(g[p], g[fa[p]]);
      if (i % 2 == 0) f[i] = min(f[i], make_pair(g[p].first + 1, g[p].second));
    }
    if (i % 2 == 0 && s[i] == s[i - 1])
      f[i] = min(f[i], make_pair(f[i - 2].first, i - 2));
  }
  if (f[n].first > n)
    puts("-1");
  else {
    printf("%d\n", f[n].first);
    int p = n;
    while (p) {
      if (p - f[p].second != 2)
        printf("%d %d\n", f[p].second / 2 + 1, (p + 1) / 2);
      p = f[p].second;
    }
  }
}
