#include <bits/stdc++.h>
using namespace std;
const int N = 2505;
char a[N], b[N], c[N];
int dp1[N][N], dp2[N][N], dp[N], step[N], ans[N][2];
int main() {
  scanf("%s%s", a + 1, b + 1);
  int len1 = strlen(a + 1);
  int len2 = strlen(b + 1);
  for (int i = 1; i <= len2; i++) dp[i] = 1e8;
  for (int i = 1; i <= len1; i++) c[i] = a[len1 - i + 1];
  for (int i = 1; i <= len1; i++)
    for (int j = 1; j <= len2; j++) {
      if (a[i] == b[j]) dp1[i][j] = dp1[i - 1][j - 1] + 1;
      if (b[j] == c[i]) dp2[i][j] = dp2[i - 1][j - 1] + 1;
    }
  for (int i = 1; i <= len2; i++)
    for (int j = 1; j <= len1; j++) {
      if (dp1[j][i]) {
        if (dp[i] > dp[i - dp1[j][i]] + 1) {
          dp[i] = dp[i - dp1[j][i]] + 1;
          step[i] = i - dp1[j][i];
        }
      }
      if (dp2[j][i]) {
        if (dp[i] > dp[i - dp2[j][i]] + 1) {
          dp[i] = dp[i - dp2[j][i]] + 1;
          step[i] = i - dp2[j][i];
        }
      }
    }
  if (dp[len2] == 1e8) return puts("-1"), 0;
  printf("%d\n", dp[len2]);
  int sum = dp[len2];
  int now = len2;
  while (sum--) {
    for (int i = 1; i <= len1; i++) {
      if (dp1[i][now] == now - step[now]) {
        ans[sum][0] = i - dp1[i][now] + 1, ans[sum][1] = i;
        now = step[now];
        break;
      }
      if (dp2[i][now] == now - step[now]) {
        ans[sum][0] = len1 - i + dp2[i][now], ans[sum][1] = len1 - i + 1;
        now = step[now];
        break;
      }
    }
  }
  for (int i = 0; i < dp[len2]; i++) printf("%d %d\n", ans[i][0], ans[i][1]);
  return 0;
}
