#include <bits/stdc++.h>
using namespace std;
int n, m;
char s[2111], t[2111], rs[2111];
int lcps[2111][2111], lcprs[2111][2111];
int frs[2111], frrs[2111];
int dp[2111], last[2111];
pair<int, int> g[2111];
int cnt[222];
void dfs(int k) {
  if (k <= 0) return;
  dfs(last[k]);
  int l, r;
  l = g[k].first;
  r = g[k].second;
  if (l < r)
    if (r - l + 1 > k - last[k]) {
      r = l + (k - last[k] - 1);
    } else if (l - r + 1 > k - last[k]) {
      r = l - (k - last[k] - 1);
    }
  printf("%d %d\n", l, r);
}
int main() {
  gets(s + 1);
  gets(t + 1);
  n = strlen(s + 1);
  m = strlen(t + 1);
  for (int i = 1; i <= n; i++) {
    cnt[s[i]]++;
  }
  for (int i = 1; i <= m; i++) {
    if (cnt[t[i]] == 0) {
      puts("-1");
      return 0;
    }
  }
  for (int i = 1; i <= n; i++) {
    rs[i] = s[n - i + 1];
  }
  for (int i = n; i >= 1; i--) {
    for (int j = m; j >= 1; j--) {
      if (s[i] == t[j]) {
        lcps[i][j] = lcps[i + 1][j + 1] + 1;
        if (lcps[0][j] < lcps[i][j]) {
          lcps[0][j] = lcps[i][j];
          frs[j] = i;
        }
      }
      if (rs[i] == t[j]) {
        lcprs[i][j] = lcprs[i + 1][j + 1] + 1;
        if (lcprs[0][j] < lcprs[i][j]) {
          lcprs[0][j] = lcprs[i][j];
          frrs[j] = i;
        }
      }
    }
  }
  int l, r;
  for (int i = 1; i <= m; i++) {
    r = lcps[0][i];
    if (l != 0)
      for (l = 1; l <= r; l++)
        if (dp[i + l - 1] == 0 || dp[i + l - 1] > dp[i - 1] + 1) {
          dp[i + l - 1] = dp[i - 1] + 1;
          last[i + l - 1] = i - 1;
          g[i + l - 1] = make_pair(frs[i], frs[i] + l - 1);
        }
    r = lcprs[0][i];
    if (l != 0)
      for (l = 1; l <= r; l++)
        if (dp[i + l - 1] == 0 || dp[i + l - 1] > dp[i - 1] + 1) {
          dp[i + l - 1] = dp[i - 1] + 1;
          last[i + l - 1] = i - 1;
          g[i + l - 1] = make_pair(n + 1 - frrs[i], n + 1 - (frrs[i] + l - 1));
        }
  }
  if (dp[m] == 0) {
    puts("-1");
    return 0;
  }
  cout << dp[m] << endl;
  dfs(m);
}
