#include <bits/stdc++.h>
using namespace std;
const int N = 2500;
int dp1[N][N];
int dp2[N][N];
vector<pair<int, int> > v;
char s[N], t[N];
int main() {
  scanf("%s%s", s + 1, t + 1);
  int n = strlen(s + 1), m = strlen(t + 1);
  int i, j;
  for (i = 1; i <= m; i++)
    for (j = 1; j <= n; j++) {
      if (s[j] == t[i]) {
        dp1[i][j] = max(dp1[i][j], dp1[i - 1][j - 1] + 1);
      }
    }
  for (i = 1; i <= m; i++)
    for (j = n; j >= 1; j--) {
      if (s[j] == t[i]) dp2[i][j] = max(dp2[i][j], dp2[i - 1][j + 1] + 1);
    }
  int mx = 0, l, r;
  for (i = m; i >= 1;) {
    mx = 0;
    for (j = 1; j <= n; j++) {
      if (mx < dp1[i][j]) {
        mx = dp1[i][j];
        l = j - mx + 1;
        r = j;
      }
    }
    for (j = 1; j <= n; j++) {
      if (dp2[i][j] > mx) {
        mx = dp2[i][j];
        l = j + mx - 1;
        r = j;
      }
    }
    if (mx == 0) {
      break;
    }
    v.push_back(make_pair(l, r));
    i -= mx;
  }
  if (i >= 1) {
    puts("-1");
  } else {
    pair<int, int> p;
    cout << v.size() << endl;
    while (v.size()) {
      p = *v.rbegin();
      cout << p.first << " " << p.second << endl;
      v.pop_back();
    }
  }
}
