Problem: Hurricane came to Berland and to suburbs Stringsvill. You are going to it to check if it's all right with you favorite string. Hurrinace broke it a bit by reversing some of its non-intersecting substrings. You have a photo of this string before hurricane and you want to restore it to original state using reversing minimum possible number of its substrings and find out which substrings you should reverse.

You are given a string s — original state of your string and string t — state of the string after hurricane. You should select k non-intersecting substrings of t in such a way that after reverse of these substrings string will be equal s and k is minimum possible.

Input

First line of input contains string s and second line contains string t. Both strings have same length and consist of lowercase English letters. 1 ≤ |s| = |t| ≤ 5·105

Output

In first line print k — minimum number of substrings you should reverse. Next output k lines. Each line should contain two integers li, ri meaning that you should reverse substring from symbol number li to symbol ri (strings are 1-indexed). These substrings shouldn't intersect. If there are multiple answers print any. If it's impossible to restore string output -1.

Example

Input

abcxxxdef
cbaxxxfed


Output

2
7 9
1 3

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
using namespace rel_ops;
using ll = int64_t;
using Pii = pair<int, int>;
using ull = uint64_t;
using Vi = vector<int>;
void run();
int main() {
  cin.sync_with_stdio(0);
  cin.tie(0);
  cout << fixed << setprecision(10);
  run();
  return 0;
}
int uplg(int n) { return 32 - __builtin_clz(n); }
int uplg(ll n) { return 64 - __builtin_clzll(n); }
int cmp(double a, double b, double eps = 1e-9) {
  return (a > b + eps) - (a + eps < b);
}
using State = pair<int, Pii>;
constexpr int ALPHA = 26;
constexpr int INF = 1e9;
struct PalTree {
  Vi txt, len{0, -1}, link{1, 0};
  vector<array<int, ALPHA>> to{{}, {}};
  int last{0};
  Vi diff{0, 0}, slink{0, 0};
  vector<State> series{make_pair(0, make_pair(0, 0)),
                       make_pair(0, make_pair(0, 0))},
      ans{make_pair(0, make_pair(0, 0))};
  State choose(State a, State b) {
    if (a.first <= b.first) return a;
    return b;
  }
  int ext(int i) {
    while (len[i] + 2 > int((txt).size()) ||
           txt[int((txt).size()) - len[i] - 2] != txt.back())
      i = link[i];
    return i;
  }
  void add(int first) {
    txt.push_back(first);
    last = ext(last);
    if (!to[last][first]) {
      len.push_back(len[last] + 2);
      link.push_back(to[ext(link[last])][first]);
      to[last][first] = int((to).size());
      to.emplace_back();
      diff.push_back(len.back() - len[link.back()]);
      slink.push_back(diff.back() == diff[link.back()] ? slink[link.back()]
                                                       : link.back());
      series.push_back({INF, {0, 0}});
    }
    last = to[last][first];
    ans.push_back({INF, {0, 0}});
    for (int i = last; len[i] > 0; i = slink[i]) {
      series[i] = ans[int((ans).size()) - len[slink[i]] - diff[i] - 1];
      if (diff[i] == diff[link[i]])
        series[i] = choose(series[i], series[link[i]]);
      if (int((txt).size()) % 2 == 0) {
        auto alt = series[i];
        alt.first++;
        alt.second.first = alt.second.second;
        alt.second.second = int((txt).size());
        ans.back() = choose(ans.back(), alt);
      }
    }
    if (int((txt).size()) % 2 == 0 && txt[int((txt).size()) - 2] == first) {
      auto alt = ans[int((ans).size()) - 3];
      alt.second.first = alt.second.second;
      alt.second.second = int((txt).size());
      ans.back() = choose(ans.back(), alt);
    }
  }
};
void run() {
  cin.sync_with_stdio(0);
  cin.tie(0);
  string A, B;
  cin >> A >> B;
  PalTree tree;
  for (int i = (0); i < (int((A).size())); i++) {
    tree.add(A[i] - 'a');
    tree.add(B[i] - 'a');
  }
  if (tree.ans.back().first == INF) {
    cout << -1 << endl;
    return;
  }
  cout << tree.ans.back().first << '\n';
  for (State s = tree.ans.back(); s.first > 0; s = tree.ans[s.second.first]) {
    if (s.second.second - s.second.first > 2) {
      int a = s.second.first / 2, b = s.second.second / 2;
      cout << a + 1 << ' ' << b << '\n';
    }
  }
}