#include <bits/stdc++.h>
int t[3000], next[3000], d[3000], e[3000][3000], r[3000][3000], l[3000];
char a[3000], b[3000];
void baga(int p) {
  if (p == 0) {
    return;
  }
  baga(next[p]);
  if (t[p] > 0) {
    fprintf(stdout, "%d %d\n", t[p] - (p - next[p]) + 1, t[p]);
  } else {
    fprintf(stdout, "%d %d\n", -t[p] + (p - next[p] - 1), -t[p]);
  }
}
int main() {
  int ans, n, m, i, j, k;
  char ch, aux;
  ch = fgetc(stdin);
  n = 0;
  while (ch != '\n') {
    a[++n] = ch;
    ch = fgetc(stdin);
  }
  ch = fgetc(stdin);
  m = 0;
  while (ch != '\n') {
    b[++m] = ch;
    ch = fgetc(stdin);
  }
  for (i = 1; i <= n; i++) {
    for (j = 1; j <= m; j++) {
      if (a[i] == b[j]) {
        e[i][j] = e[i - 1][j - 1] + 1;
        if (e[i][j] > l[j]) {
          l[j] = e[i][j];
          t[j] = i;
        }
      }
    }
  }
  for (i = 1, j = n; i < j; i++, j--) {
    aux = a[i];
    a[i] = a[j];
    a[j] = aux;
  }
  for (i = 1, k = n; i <= n; i++, k--) {
    for (j = 1; j <= m; j++) {
      if (a[i] == b[j]) {
        r[i][j] = r[i - 1][j - 1] + 1;
        if (r[i][j] > l[j]) {
          l[j] = r[i][j];
          t[j] = -k;
        }
      }
    }
  }
  ans = n;
  for (i = 1; i <= m; i++) {
    if (l[i] == 0) {
      ans = 0;
    }
  }
  for (i = 1; i <= m; i++) {
    d[i] = m + 1;
    for (j = 1; j <= l[i]; j++) {
      if (d[i] > d[i - j] + 1) {
        d[i] = d[i - j] + 1;
        next[i] = i - j;
      }
    }
  }
  if (ans == 0) {
    fprintf(stdout, "-1\n");
  } else {
    fprintf(stdout, "%d\n", d[m]);
    baga(m);
  }
  fclose(stdin);
  fclose(stdout);
  return 0;
}
