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;
inline int in() {
  int32_t x;
  scanf("%d", &x);
  return x;
}
const int maxn = 1e6 + 10;
const int mod = 1e9 + 7;
const int inf = 1e9 + 10;
int n, curStringLen;
string s, t, T;
int dp[maxn], len[maxn], suff_link[maxn], prev_chain_link[maxn],
    preNode = 0, nxt[maxn][26], sz, chain_diff[maxn];
inline int doJob(int node) {
  while (T[curStringLen - 2 - len[node]] != T[curStringLen - 1])
    node = suff_link[node];
  return node;
}
pair<int, int> chain_dp[maxn];
inline void add_letter(int ch) {
  T[curStringLen++] = ch;
  preNode = doJob(preNode);
  if (nxt[preNode][ch]) {
    preNode = nxt[preNode][ch];
    return;
  }
  len[sz] = len[preNode] + 2;
  suff_link[sz] = nxt[doJob(suff_link[preNode])][ch];
  chain_diff[sz] = len[sz] - len[suff_link[sz]];
  prev_chain_link[sz] = (chain_diff[sz] == chain_diff[suff_link[sz]])
                            ? prev_chain_link[suff_link[sz]]
                            : suff_link[sz];
  preNode = nxt[preNode][ch] = sz++;
}
inline void eertreeInit() {
  suff_link[0] = 1;
  len[1] = -1;
  curStringLen = 1;
  T[0] = '!';
  sz = 2;
}
int lastL[maxn];
int32_t main() {
  cin >> s >> t;
  n = (int)s.size();
  T.resize(2 * n + 1);
  eertreeInit();
  n *= 2;
  for (int i = 1; i <= n; i++) dp[i] = inf;
  for (int i = 1; i <= n; i++) {
    if (i & 1)
      add_letter(s[i / 2] - 'a');
    else
      add_letter(t[i / 2 - 1] - 'a');
    bool fl = (i % 2) == 0;
    for (int node = preNode; len[node] > 0; node = prev_chain_link[node]) {
      int firstinChainLen = len[prev_chain_link[node]] + chain_diff[node];
      chain_dp[node].first = dp[i - firstinChainLen] + 1;
      chain_dp[node].second = i - firstinChainLen + 1;
      if (chain_diff[node] == chain_diff[suff_link[node]])
        chain_dp[node] = min(chain_dp[node], chain_dp[suff_link[node]]);
      if (fl)
        if (chain_dp[node].first < dp[i]) {
          dp[i] = chain_dp[node].first, lastL[i] = chain_dp[node].second;
        }
    }
    if (fl && dp[i - 2] < dp[i] && t[i / 2 - 1] == s[i / 2 - 1]) {
      dp[i] = dp[i - 2], lastL[i] = i - 1;
    }
  }
  if (dp[n] == inf) return cout << -1 << "\n", 0;
  cout << dp[n] << "\n";
  while (n) {
    if (lastL[n] + 2 < n) {
      cout << lastL[n] / 2 + 1 << " " << n / 2 << "\n";
    }
    n = lastL[n] - 1;
  }
}