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 inf = 1e9;
int n;
char str1[1000010], str2[1000010];
char s[1000010];
int l = 0;
int fa[1000010], ch[1000010][26], fail[1000010];
int len[1000010];
int anc[1000010];
int f[1000010], g[1000010];
int last = 1, tot = 1;
int remf[1000010], remg[1000010];
inline int getfail(int x) {
  while (s[l - len[x] - 1] != s[l]) x = fail[x];
  return x;
}
inline void insert(int dir) {
  l++;
  int tmp = getfail(last);
  if (!ch[tmp][dir]) {
    tot++;
    memset(ch[tot], 0, sizeof(ch[tot]));
    len[tot] = len[tmp] + 2;
    fa[tot] = tmp;
    fail[tot] = ch[getfail(fail[tmp])][dir];
    ch[tmp][dir] = tot;
    anc[tot] = ((fail[tot] > 1 && len[tot] - len[fail[tot]] ==
                                      len[fail[tot]] - len[fail[fail[tot]]])
                    ? anc[fail[tot]]
                    : tot);
  }
  last = ch[tmp][dir];
}
int main() {
  memset(ch[0], 0, sizeof(ch[0]));
  memset(ch[1], 0, sizeof(ch[1]));
  fail[0] = 1;
  len[1] = -1;
  s[0] = -1;
  scanf("%s", str1 + 1);
  scanf("%s", str2 + 1);
  n = strlen(str1 + 1);
  for (register int i = 1; i <= n; ++i) s[(i << 1) - 1] = str1[i];
  for (register int i = 1; i <= n; ++i) s[i << 1] = str2[i];
  n <<= 1;
  anc[0] = 0;
  anc[1] = 1;
  remf[0] = remf[1] = inf;
  for (register int i = 1; i <= n; ++i) {
    f[i] = inf;
    insert(s[i] - 'a');
    for (int u = last; u > 1; u = fail[anc[u]]) {
      remf[u] = f[i - len[anc[u]]];
      remg[u] = i - len[anc[u]];
      if (anc[u] != u && remf[fail[u]] < remf[u])
        remf[u] = remf[fail[u]], remg[u] = remg[fail[u]];
      if ((!(i & 1)) && f[i] > remf[u] + 1) f[i] = remf[u] + 1, g[i] = remg[u];
    }
    if ((!(i & 1)) && s[i - 1] == s[i] && f[i - 2] < f[i])
      f[i] = f[i - 2], g[i] = i - 2;
  }
  if (f[n] == inf) {
    puts("-1");
    return 0;
  }
  printf("%d\n", f[n]);
  for (int i = n; i; i = g[i])
    if (i - g[i] > 2) printf("%d %d\n", (g[i] >> 1) + 1, i >> 1);
  return 0;
}