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 = 1000005;
char s[N], t[N], S[N];
int n, ch[N][26], fa[N];
int len[N], anc[N], dif[N], nd, la;
int ans[N], _ans[N], from[N];
void extend(int n) {
  int c = S[n], p = la;
  for (; S[n - len[p] - 1] != c; p = fa[p])
    ;
  if (!ch[p][c - 'a']) {
    len[++nd] = len[p] + 2;
    int q = fa[p];
    for (; S[n - len[q] - 1] != c; q = fa[q])
      ;
    fa[nd] = ch[q][c - 'a'];
    ch[p][c - 'a'] = nd;
    dif[nd] = len[nd] - len[fa[nd]];
    anc[nd] = (dif[nd] == dif[fa[nd]] ? anc[fa[nd]] : fa[nd]);
  }
  la = ch[p][c - 'a'];
}
int main() {
  scanf("%s%s", s + 1, t + 1);
  n = strlen(s + 1);
  for (int i = (int)(1); i <= (int)(n); i++)
    S[i * 2 - 1] = s[i], S[i * 2] = t[i];
  fa[0] = nd = 1;
  len[1] = -1;
  n *= 2;
  for (int i = (int)(1); i <= (int)(n); i++) ans[i] = 1 << 30;
  _ans[0] = 1;
  for (int i = (int)(1); i <= (int)(n); i++) {
    extend(i);
    for (int p = la; p; p = anc[p]) {
      _ans[p] = i - (len[anc[p]] + dif[p]);
      if (dif[fa[p]] == dif[p])
        if (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) return puts("-1"), 0;
  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 / 2);
}