#include <bits/stdc++.h>
using namespace std;
const int mod1 = 1000000087;
const int mod2 = 998244353;
const int X1 = 880301;
const int X2 = 1009;
const int N = 2106;
pair<int, int> operator+(const pair<int, int> &p1, const pair<int, int> &p2) {
  return make_pair((p1.first + p2.first) % mod1,
                   (p1.second + p2.second) % mod2);
}
pair<int, int> operator-(const pair<int, int> &p1, const pair<int, int> &p2) {
  return make_pair((p1.first - p2.first + mod1) % mod1,
                   (p1.second - p2.second + mod2) % mod2);
}
pair<int, int> operator*(const pair<int, int> &p1, const pair<int, int> &p2) {
  return make_pair(p1.first * 1ll * p2.first % mod1,
                   p1.second * 1ll * p2.second % mod2);
}
pair<int, int> pre[N];
pair<int, int> ppow[N];
vector<pair<pair<int, int>, pair<int, int> > > v;
const pair<int, int> yuuki = make_pair(-1, -1);
bool hhave(pair<int, int> p) {
  auto iter = lower_bound(v.begin(), v.end(), make_pair(p, yuuki));
  if (iter == v.end()) return false;
  if (iter->first != p) return false;
  return true;
}
pair<int, int> get_range(pair<int, int> p) {
  auto iter = lower_bound(v.begin(), v.end(), make_pair(p, yuuki));
  return iter->second;
}
pair<int, int> hash_val(int L, int R) {
  return (pre[R] - pre[L - 1]) * ppow[N - L - 2];
}
int main() {
  ppow[0] = make_pair(1, 1);
  for (int i = 1; i < N; ++i) {
    ppow[i] = (ppow[i - 1]) * (make_pair(X1, X2));
  }
  string s;
  cin >> s;
  set<char> st;
  for (char i : s) st.insert(i);
  string t;
  cin >> t;
  for (char i : t) {
    if (st.find(i) == st.end()) {
      cout << -1 << endl;
      return 0;
    }
  }
  int n = (int)s.size();
  for (int i = 1; i <= n; ++i) {
    pre[i] = pre[i - 1] + (make_pair(s[i - 1], s[i - 1]) * ppow[i]);
  }
  for (int i = 1; i <= n; ++i) {
    for (int j = i; j <= n; ++j) {
      pair<int, int> val = (pre[j] - pre[i - 1]) * ppow[N - i - 2];
      v.push_back({val, {i, j}});
    }
  }
  reverse(s.begin(), s.end());
  for (int i = 1; i <= n; ++i) {
    pre[i] = pre[i - 1] + (make_pair(s[i - 1], s[i - 1]) * ppow[i]);
  }
  for (int i = 1; i <= n; ++i) {
    for (int j = i; j <= n; ++j) {
      pair<int, int> val = (pre[j] - pre[i - 1]) * ppow[N - i - 2];
      v.push_back({val, {n - i + 1, n - j + 1}});
    }
  }
  sort(v.begin(), v.end());
  t += "*";
  int m = (int)t.size();
  for (int i = 1; i <= m; ++i) {
    pre[i] = pre[i - 1] + (make_pair(t[i - 1], t[i - 1]) * ppow[i]);
  }
  vector<pair<int, int> > ans;
  for (int i = 1; i <= m;) {
    int j = i;
    while (hhave(hash_val(i, j))) ++j;
    ans.push_back(get_range(hash_val(i, j - 1)));
    i = j;
    if (i == m) break;
  }
  cout << ans.size() << endl;
  for (pair<int, int> p : ans) cout << p.first << ' ' << p.second << endl;
}
