#include <bits/stdc++.h>
using namespace std;
const int Imx = 2147483647;
const long long Lbig = 2e18;
const int mod = 1e9 + 7;
struct fastio {
  char s[100000];
  int it, len;
  fastio() { it = len = 0; }
  inline char get() {
    if (it < len) return s[it++];
    it = 0;
    len = fread(s, 1, 100000, stdin);
    if (len == 0)
      return EOF;
    else
      return s[it++];
  }
  bool notend() {
    char c = get();
    while (c == ' ' || c == '\n') c = get();
    if (it > 0) it--;
    return c != EOF;
  }
} _buff;
inline long long getnum() {
  long long r = 0;
  bool ng = 0;
  char c;
  c = _buff.get();
  while (c != '-' && (c < '0' || c > '9')) c = _buff.get();
  if (c == '-') ng = 1, c = _buff.get();
  while (c >= '0' && c <= '9') r = r * 10 + c - '0', c = _buff.get();
  return ng ? -r : r;
}
template <class T>
inline void putnum(T x) {
  if (x < 0) putchar('-'), x = -x;
  register short a[20] = {}, sz = 0;
  while (x) a[sz++] = x % 10, x /= 10;
  if (sz == 0) putchar('0');
  for (int i = sz - 1; i >= 0; i--) putchar('0' + a[i]);
}
inline char getreal() {
  char c = _buff.get();
  while (c <= 32) c = _buff.get();
  return c;
}
long long qpow(long long x, long long k) {
  return k == 0 ? 1
                : 1ll * qpow(1ll * x * x % mod, k >> 1) * (k & 1 ? x : 1) % mod;
}
int n;
char s[1000111], t[500111];
pair<int, int> pl[1000111], gpl[1000111];
struct AP {
  int st, dlt, cnt;
  AP(int St = 0, int Dlt = 0, int Cnt = 0) {
    st = St;
    dlt = Dlt;
    cnt = Cnt;
  }
  int getr() { return st + (cnt - 1) * dlt; }
};
AP g[1000111];
int gn;
int standardize(AP a[], int n) {
  if (n == 0) return 0;
  static AP na[2000111];
  int nn = 0;
  na[0] = a[0];
  for (int i = 1; i <= n; i++) {
    na[nn + 1] = AP(a[i].st, a[i].st - na[nn].getr(), 1);
    nn++;
    if (a[i].cnt > 1) na[++nn] = AP(a[i].st + a[i].dlt, a[i].dlt, a[i].cnt - 1);
  }
  AP last = na[1];
  n = 0;
  for (int i = 2; i <= nn; i++) {
    if (na[i].dlt == last.dlt)
      last.cnt += na[i].cnt;
    else
      a[++n] = last, last = na[i];
  }
  a[++n] = last;
  return n;
}
int main() {
  scanf("%s", s + 1);
  n = strlen(s + 1);
  scanf("%s", t + 1);
  for (int i = n; i >= 1; i--) s[(i << 1) - 1] = s[i];
  for (int i = 1; i <= n; i++) s[(i << 1)] = t[i];
  n = n << 1;
  g[0] = AP(-n, 0, 0);
  for (int i = 1; i <= n; i++) {
    int tn = 0;
    for (int j = 1; j <= gn; j++) {
      if (g[j].st > 0 && s[g[j].st - 1] == s[i]) {
        g[++tn] = AP(g[j].st - 1, g[j].dlt, g[j].cnt);
      }
    }
    if (i > 1 && s[i - 1] == s[i]) g[++tn] = AP(i - 1, 0, 1);
    gn = standardize(g, tn);
    pair<int, int> cur = make_pair(mod, -1);
    for (int i = 1; i <= gn; i++) {
      pair<int, int> mn =
          make_pair(pl[g[i].getr() - 1].first + 1, g[i].getr() - 1);
      if (g[i].getr() % 2 == 0) mn = make_pair(mod, -1);
      if (g[i].cnt > 1) mn = min(mn, gpl[g[i].st - g[i].dlt]);
      if (g[i].st - g[i].dlt >= 0) gpl[g[i].st - g[i].dlt] = mn;
      cur = min(cur, mn);
    }
    pl[i] = cur;
    if (i % 2 == 0 && s[i] == s[i - 1])
      pl[i] = min(pl[i], make_pair(pl[i - 2].first, i - 2));
  }
  if (pl[n].first > n) {
    puts("-1");
    return 0;
  }
  putnum(pl[n].first), putchar('\n');
  int p = n;
  while (p) {
    int l = (pl[p].second + 2) >> 1, r = (p + 1) >> 1;
    if (l < r) putnum(l), putchar(' '), putnum(r), putchar('\n');
    p = pl[p].second;
  }
  return 0;
}
