#include <bits/stdc++.h>
const int MAXN = 2e7 + 7;
using namespace std;
long long int power(long long int x, long long int y) {
  long long int res = 1;
  while (y > 0) {
    if (y & 1) {
      res = (res * x) % 1000000007;
    }
    x = (x * x) % 1000000007;
    y = y >> 1;
  }
  return res;
}
std::vector<int> divi[100004];
void divisor(int n) {
  for (int i = 1; i <= n; i++) {
    for (int j = i; j <= n; j += i) {
      divi[j].push_back(i);
    }
  }
}
vector<pair<int, int>> v[200005];
int ans[200004];
int vis[200004];
set<int> deg[200005];
vector<int> cnt[200005];
void dfs(int s, int p) {
  int val = 1;
  for (auto i : v[s]) {
    if (i.first != p) {
      while (deg[s].find(val) != deg[s].end()) val++;
      deg[s].insert(val);
      deg[i.first].insert(val);
      ans[i.second] = val;
    }
  }
  for (auto i : v[s]) {
    if (i.first != p) {
      dfs(i.first, s);
    }
  }
  return;
}
pair<int, pair<int, int>> dp[2500];
int L[2500][2500], R[2500][2500];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  for (int i = 0; i < 2500; i++) {
    dp[i] = {INT_MAX, {-1, -1}};
  }
  string s, t;
  cin >> s >> t;
  string rev = "";
  int n = s.length();
  for (int i = s.size() - 1; i >= 0; i--) {
    rev.push_back(s[i]);
  }
  for (int i = 0; i < t.length(); i++) {
    for (int j = 0; j < s.length(); j++) {
      if (t[i] == s[j]) {
        L[i][j] = 1 + ((i > 0 && j > 0) ? L[i - 1][j - 1] : 0);
      }
      if (t[i] == rev[j]) {
        R[i][j] = 1 + ((i > 0 && j > 0) ? R[i - 1][j - 1] : 0);
      }
    }
  }
  for (int i = 0; i < t.length(); i++) {
    for (int j = 0; j < s.length(); j++) {
      if (i == L[i][j] - 1) {
        dp[i].first = 1;
        dp[i].second = {j - L[i][j] + 1, j};
        continue;
      } else if (dp[i - L[i][j]].first != INT_MAX &&
                 dp[i - L[i][j]].first + 1 < dp[i].first) {
        dp[i].first = dp[i - L[i][j]].first + 1;
        dp[i].second = {j - L[i][j] + 1, j};
      }
      if (i == R[i][j] - 1) {
        dp[i].first = 1;
        dp[i].second = {n - j - 1 + R[i][j] - 1, n - j - 1};
      } else if (dp[i - R[i][j]].first != INT_MAX &&
                 dp[i - R[i][j]].first + 1 < dp[i].first) {
        dp[i].first = dp[i - R[i][j]].first + 1;
        dp[i].second = {n - j - 1 + R[i][j] - 1, n - j - 1};
      }
    }
  }
  if (dp[t.length() - 1].first == INT_MAX) {
    cout << -1 << endl;
    return 0;
  }
  vector<pair<int, int>> ans;
  int i = t.length() - 1;
  while (i >= 0) {
    ans.push_back(dp[i].second);
    i = i - abs(dp[i].second.first - dp[i].second.second) - 1;
  }
  cout << ans.size() << endl;
  while (ans.size()) {
    cout << ans.back().first + 1 << " " << ans.back().second + 1 << endl;
    ans.pop_back();
  }
  return 0;
}
