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 + 7;
int n, tot, s[N], ch[N][26], len[N], fa[N], tran[N], d[N];
char S[N];
pair<int, int> f[N], g[N];
int extend(int n, int p, char c) {
  int idx = c - 'a';
  while (s[n - len[p] - 1] != c) p = fa[p];
  if (!ch[p][idx]) {
    int q = ++tot, t = fa[p];
    len[q] = len[p] + 2;
    while (s[n - len[t] - 1] != c) t = fa[t];
    fa[q] = ch[t][idx], ch[p][idx] = q, d[q] = len[q] - len[fa[q]];
    tran[q] = d[q] == d[fa[q]] ? tran[fa[q]] : fa[q];
  }
  return ch[p][idx];
}
int main() {
  fa[0] = tot = 1, len[1] = -1;
  scanf("%s", S + 1), n = strlen(S + 1);
  for (int i = 1; i <= n; i++) s[(i << 1) - 1] = S[i];
  scanf("%s", S + 1);
  for (int i = 1; i <= n; i++) s[i << 1] = S[i];
  n = n << 1;
  int st = 0;
  for (int i = 1; i <= n; i++) {
    f[i] = make_pair(1e9, -1);
    st = extend(i, st, s[i]);
    for (int p = st; p; p = tran[p]) {
      int lst = i - len[tran[p]] - d[p];
      g[p] = make_pair(f[lst].first, lst);
      if (d[fa[p]] == d[p]) g[p] = min(g[p], g[fa[p]]);
      if (i % 2 == 0) f[i] = min(f[i], make_pair(g[p].first + 1, g[p].second));
    }
    if (i % 2 == 0 && s[i] == s[i - 1])
      f[i] = min(f[i], make_pair(f[i - 2].first, i - 2));
  }
  if (f[n].first > n)
    puts("-1");
  else {
    printf("%d\n", f[n].first);
    int p = n;
    while (p) {
      if (p - f[p].second != 2)
        printf("%d %d\n", f[p].second / 2 + 1, (p + 1) / 2);
      p = f[p].second;
    }
  }
}