#include <bits/stdc++.h>
using namespace std;
template <typename T>
T gcd(T a, T b) {
  if (a == 0) return b;
  return gcd(b % a, a);
}
template <typename T>
T pow(T a, T b, long long m) {
  T ans = 1;
  while (b > 0) {
    if (b % 2 == 1) ans = ((ans % m) * (a % m)) % m;
    b /= 2;
    a = ((a % m) * (a % m)) % m;
  }
  return ans % m;
}
const long double eps = 1e-10L;
vector<int> g[30];
string s, t;
int dp[2200];
int lcp[2200][2200];
int lcp_prev[2200][2200];
void LCP() {
  int m = t.length();
  int n = s.length();
  for (int i = m - 1; i >= 0; i--)
    for (int j = n - 1; j >= 0; j--)
      if (t[i] == s[j]) lcp[i][j] = lcp[i + 1][j + 1] + 1;
  for (int i = m - 1; i >= 0; i--)
    for (int j = 0; j < n; j++)
      if (t[i] == s[j]) {
        if (j - 1 >= 0)
          lcp_prev[i][j] = lcp_prev[i + 1][j - 1] + 1;
        else
          lcp_prev[i][j] = 1;
      }
}
int solve(int x) {
  if (x >= t.length()) return 0;
  if (dp[x] != -1) return dp[x];
  int ans = 1000000;
  int id = t[x] - 'a';
  for (int i = 0; i < g[id].size(); i++) {
    int l = g[id][i];
    ans = min(ans, 1 + solve(x + lcp[x][l]));
    ans = min(ans, 1 + solve(x + lcp_prev[x][l]));
  }
  return dp[x] = ans;
}
void print(int x) {
  if (x >= t.length()) return;
  int ans = 1000000;
  int id = t[x] - 'a';
  for (int i = 0; i < g[id].size(); i++) {
    int l = g[id][i];
    if (dp[x] == 1 + solve(x + lcp[x][l])) {
      cout << l + 1 << " " << l + lcp[x][l] << "\n";
      print(x + lcp[x][l]);
      return;
    }
    ans = min(ans, 1 + solve(x + lcp_prev[x][l]));
    if (dp[x] == 1 + solve(x + lcp_prev[x][l])) {
      cout << l + 1 << " " << l - lcp_prev[x][l] + 2 << "\n";
      print(x + lcp_prev[x][l]);
      return;
    }
  }
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  cin >> s >> t;
  for (int i = 0; i < s.length(); i++) g[s[i] - 'a'].push_back(i);
  LCP();
  memset(dp, -1, sizeof dp);
  int ans = solve(0);
  if (ans == 1000000) {
    cout << "-1";
    return 0;
  }
  cout << ans << "\n";
  print(0);
}
