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;
char s[1000005], t[1000005], S[1000005];
int n, ch[1000005][26], len[1000005], fa[1000005];
int top, la, dif[1000005], lk[1000005];
void extend(int n) {
  int w = S[n], p = la;
  for (; S[n - len[p] - 1] != w; p = fa[p])
    ;
  if (!ch[p][w - 'a']) {
    len[++top] = len[p] + 2;
    int q = top, now = p;
    do now = fa[now];
    while (S[n - len[now] - 1] != w);
    fa[q] = ch[now][w - 'a'];
    ch[p][w - 'a'] = q;
    dif[q] = len[q] - len[fa[q]];
    lk[q] = (dif[q] == dif[fa[q]] ? lk[fa[q]] : fa[q]);
  }
  la = ch[p][w - 'a'];
}
int ans[1000005], _ans[1000005], from[1000005];
int main() {
  scanf("%s%s", s + 1, t + 1);
  int n = strlen(s + 1);
  for (int i = 1; i <= n; i++) S[i * 2 - 1] = s[i], S[i * 2] = t[i];
  fa[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 = la; p; p = lk[p]) {
      _ans[p] = i - (len[lk[p]] + dif[p]);
      if (dif[fa[p]] == dif[p] && ans[_ans[p]] > ans[_ans[fa[p]]])
        _ans[p] = _ans[fa[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] >> 1) + 1, i >> 1);
  } else
    puts("-1");
}