#include <bits/stdc++.h>
using namespace std;
struct state {
  int len, it, e;
  state(int len, int it, int e) : len(len), it(it), e(e) {}
};
const int N = 3001, oo = 2e9;
int n, m, dp[N];
char a[N], b[N];
vector<int> node(26, -1), E;
vector<vector<int> > g;
vector<pair<int, int> > sol;
vector<state> can[N];
void add(int s, int it) {
  int cur = 0;
  for (int i = s; i < n; ++i) {
    if (g[cur][a[i] - 'a'] == -1) {
      g[cur][a[i] - 'a'] = g.size();
      g.push_back(node);
      E.push_back(-1);
    }
    cur = g[cur][a[i] - 'a'];
    if (!it)
      E[cur] = i;
    else
      E[cur] = n - s - 1;
  }
}
void find(int s, int it) {
  int cur = 0, len = 1;
  for (int i = s; i < m; ++i) {
    if (g[cur][b[i] - 'a'] == -1) return;
    cur = g[cur][b[i] - 'a'];
    can[s].push_back(state(len++, it, E[cur]));
  }
}
int calc(int at) {
  if (at == m) return 0;
  int &res = dp[at];
  if (res != -1) return res;
  res = oo;
  for (size_t i = 0; i < can[at].size(); ++i)
    res = min(res, calc(at + can[at][i].len) + 1);
  return res;
}
void path(int at) {
  if (at == m) return;
  int res = calc(at);
  for (size_t i = 0; i < can[at].size(); ++i)
    if (calc(at + can[at][i].len) + 1 == res) {
      int s = can[at][i].e - can[at][i].len + 1;
      if (!can[at][i].it)
        sol.push_back(make_pair(s, can[at][i].e));
      else
        sol.push_back(make_pair(can[at][i].e, s));
      path(at + can[at][i].len);
      return;
    }
}
int main() {
  scanf("%s%s", a, b);
  n = strlen(a);
  m = strlen(b);
  for (int it = 0; it < 2; ++it) {
    g.push_back(node);
    E.push_back(-1);
    for (int i = 0; i < n; ++i) add(i, it);
    for (int i = 0; i < m; ++i) find(i, it);
    g.clear();
    E.clear();
    reverse(a, a + n);
  }
  memset(dp, -1, sizeof dp);
  int res = calc(0);
  if (res == oo) {
    puts("-1");
    return 0;
  }
  printf("%d\n", res);
  path(0);
  for (size_t i = 0; i < sol.size(); ++i)
    printf("%d %d\n", sol[i].first + 1, sol[i].second + 1);
  return 0;
}
