#include <bits/stdc++.h>
using namespace std;
int n, all, last, c[26][1000005], fail[1000005], len[1000005], half[1000005],
    dif[1000005], slink[1000005], f[1000005], g[1000005], sum[1000005],
    pre[1000005], pg[1000005];
char s[1000005], str[1000005];
void inti() {
  all = last = 1;
  fail[0] = 1;
  len[1] = -1;
}
void attend(int p, int x) {
  int pos = last;
  while (s[p] != s[p - len[pos] - 1]) pos = fail[pos];
  if (!c[x][pos]) {
    len[++all] = len[pos] + 2;
    int k = fail[pos];
    while (s[p] != s[p - len[k] - 1]) k = fail[k];
    fail[all] = c[x][k], c[x][pos] = all;
    if (len[pos] > 1) {
      k = half[pos];
      while (s[p] != s[p - len[k] - 1] || len[k] + 2 > len[all] / 2)
        k = fail[k];
      half[all] = c[x][k];
    }
    dif[all] = len[all] - len[fail[all]];
    if (dif[all] == dif[fail[all]])
      slink[all] = slink[fail[all]];
    else
      slink[all] = fail[all];
  }
  last = c[x][pos];
}
int main() {
  scanf("%s", str + 1);
  n = strlen(str + 1);
  scanf("%s", str + n + 1);
  reverse(str + n + 1, str + n + n + 1);
  n <<= 1;
  for (int i = 1; i <= n; i += 2) s[i] = str[i + 1 >> 1];
  for (int i = 2; i <= n; i += 2) s[i] = str[n - i / 2 + 1];
  for (int i = 2; i <= n; i += 2) sum[i] = sum[i - 2] + (s[i] != s[i - 1]);
  inti();
  for (int i = 1; i <= n; ++i) {
    attend(i, s[i] - 'a');
    f[i] = 1e9;
    if (!(i & 1) && s[i] == s[i - 1]) f[i] = f[i - 2], pre[i] = i - 2;
    for (int x = last; x > 1; x = slink[x]) {
      pg[x] = i - len[slink[x]] - dif[x];
      if (dif[x] == dif[fail[x]] && f[pg[x]] > f[pg[fail[x]]])
        pg[x] = pg[fail[x]];
      if (!(i & 1) && f[i] > f[pg[x]] + 1) f[i] = f[pg[x]] + 1, pre[i] = pg[x];
    }
  }
  if (f[n] == 1e9)
    puts("-1");
  else {
    cout << f[n] << '\n';
    for (int i = n; i; i = pre[i])
      if (i - pre[i] != 2) cout << pre[i] / 2 + 1 << ' ' << i / 2 << '\n';
  }
}
