#include <bits/stdc++.h>
using namespace std;
int n, m, a[3001], c[3001];
int f1[3001][3001], f2[3001][3001];
char t1[3001], t2[3001];
int r1[3001], r2[3001], tot = 0;
inline void init() {
  scanf("%s%s", &t1, &t2);
  n = strlen(t1);
  m = strlen(t2);
  for (int i = 1; i <= n; i++) a[i] = t1[i - 1] - '0';
  for (int i = 1; i <= m; i++) c[i] = t2[i - 1] - '0';
  for (int i = m; i >= 1; i--)
    for (int j = n; j >= 1; j--)
      if (a[j] == c[i]) f1[i][j] = f1[i + 1][j + 1] + 1;
  for (int i = m; i >= 1; i--)
    for (int j = n; j >= 1; j--)
      if (a[j] == c[i]) f2[i][j] = f2[i + 1][j - 1] + 1;
  for (int i = 1, s, t, ans; i <= m;) {
    s = 1;
    t = 1;
    for (int j = 1; j <= n; j++)
      if (f1[i][j] > f1[i][s]) s = j;
    for (int j = 1; j <= n; j++)
      if (f2[i][j] > f2[i][t]) t = j;
    ans = max(f1[i][s], f2[i][t]);
    if (ans == 0) {
      cout << "-1";
      return;
    }
    if (f1[i][s] > f2[i][t]) {
      r1[++tot] = s;
      r2[tot] = s + f1[i][s] - 1;
    } else {
      r1[++tot] = t;
      r2[tot] = t - f2[i][t] + 1;
    }
    i += ans;
  }
  cout << tot << endl;
  for (int i = 1; i <= tot; i++) cout << r1[i] << " " << r2[i] << endl;
}
int main() {
  init();
  return 0;
}
