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;
const int N = 1e6 + 10;
char s[N], t[N], S[N];
int n, go[N][26], len[N], par[N], top, last;
int New(int L) {
  len[++top] = L;
  return top;
}
int diff[N], slink[N];
void extend(int n) {
  int w = S[n], p = last;
  while (S[n - len[p] - 1] != w) p = par[p];
  if (!go[p][w - 'a']) {
    int q = New(len[p] + 2), now = p;
    do now = par[now];
    while (S[n - len[now] - 1] != w);
    par[q] = go[now][w - 'a'];
    go[p][w - 'a'] = q;
    diff[q] = len[q] - len[par[q]];
    slink[q] = (diff[q] == diff[par[q]] ? slink[par[q]] : par[q]);
  }
  last = go[p][w - 'a'];
}
int ans[N], from[N], _ans[N];
int main() {
  scanf("%s%s", s + 1, t + 1);
  n = strlen(s + 1);
  for (int i = 1; i <= n; i++) S[i * 2 - 1] = s[i], S[i * 2] = t[i];
  par[0] = top = 1;
  len[1] = -1;
  n *= 2;
  for (int i = 1; i <= n; i++) ans[i] = 1e9;
  _ans[0] = 1;
  for (int i = 1; i <= n; i++) {
    extend(i);
    for (int p = last; p; p = slink[p]) {
      _ans[p] = i - (len[slink[p]] + diff[p]);
      if (diff[par[p]] == diff[p] && ans[_ans[p]] > ans[_ans[par[p]]])
        _ans[p] = _ans[par[p]];
      if (!(i & 1) && ans[i] > ans[_ans[p]] + 1)
        ans[i] = ans[_ans[p]] + 1, from[i] = _ans[p];
    }
    if (!(i & 1) && S[i - 1] == S[i] && ans[i] > ans[i - 2])
      ans[i] = ans[i - 2], from[i] = i - 2;
  }
  if (ans[n] < 1e9) {
    printf("%d\n", ans[n]);
    for (int i = n; i; i = from[i])
      if (i - from[i] > 2) printf("%d %d\n", (from[i] + 2) >> 1, i >> 1);
  } else
    puts("-1");
  return 0;
}