#include <bits/stdc++.h>
using namespace std;
int n, cnt, fail[1000050], ch[1000050][26], len[1000050], diff[1000050],
    top[1000050], lst;
int f[1000050], frm[1000050], g[1000050], pos[1000050];
char s[1000050], t[1000050], a[1000050];
vector<pair<int, int> > ans;
void insert(int x) {
  int c = a[x] - 'a', p = lst;
  for (; a[x] != a[x - len[p] - 1]; p = fail[p])
    ;
  if (!ch[p][c]) {
    int np = ++cnt, q = fail[p];
    len[np] = len[p] + 2;
    for (; a[x] != a[x - len[q] - 1]; q = fail[q])
      ;
    fail[np] = ch[q][c];
    ch[p][c] = np;
    diff[np] = len[np] - len[fail[np]];
    top[np] = diff[np] == diff[fail[np]] ? top[fail[np]] : fail[np];
  }
  lst = ch[p][c];
}
bool check(int l, int r) {
  int i;
  for (i = l; i <= r; i += 2)
    if (a[i] != a[i + 1]) return 1;
  return 0;
}
int main() {
  scanf("%s%s", s + 1, t + 1);
  int l = strlen(s + 1), i;
  for (i = 1; i <= l; i++) a[++n] = s[i], a[++n] = t[i];
  fail[0] = fail[1] = 1;
  len[1] = -1;
  cnt = 1;
  diff[0] = 1;
  lst = 0;
  g[0] = 1 << 30;
  for (i = 1; i <= n; i++) {
    insert(i);
    f[i] = 1 << 30;
    if (a[i] == a[i - 1]) f[i] = f[i - 2], frm[i] = i - 2;
    int p = lst;
    for (; p; p = top[p]) {
      g[p] = f[i - len[top[p]] - diff[p]];
      pos[p] = i - len[top[p]] - diff[p];
      if (diff[p] == diff[fail[p]] && g[fail[p]] < g[p]) {
        g[p] = g[fail[p]];
        pos[p] = pos[fail[p]];
      }
      if (g[p] + 1 < f[i]) {
        f[i] = g[p] + 1;
        frm[i] = pos[p];
      }
    }
    if (i & 1) f[i] = 1 << 30;
  }
  if (f[n] == 1 << 30) {
    puts("-1");
    return 0;
  }
  while (n) {
    if (check(frm[n] + 1, n))
      ans.push_back(pair<int, int>(frm[n] / 2 + 1, n / 2));
    n = frm[n];
  }
  int lim = ans.size();
  printf("%d\n", lim);
  for (i = 0; i < lim; i++) printf("%d %d\n", ans[i].first, ans[i].second);
  return 0;
}
