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 = 1010100, INF = 1e9;
int f[N], g[N], reg[N], remf[N];
char S[N], s[N >> 1], t[N >> 1];
namespace SAM {
struct Node {
  int len, fa, ch[26], par;
} T[N];
int tot, lst;
void Init(void) {
  T[tot = lst = 1].len = -1;
  T[0].len = 0;
  T[0].fa = 1;
}
void Append(int pos, int x) {
  while (S[pos - T[lst].len - 1] != S[pos]) lst = T[lst].fa;
  if (!T[lst].ch[x]) {
    T[++tot].len = T[lst].len + 2;
    int cur = T[lst].fa;
    while (S[pos - T[cur].len - 1] != S[pos]) cur = T[cur].fa;
    T[tot].fa = T[cur].ch[x];
    T[lst].ch[x] = tot;
    int ff = T[tot].fa;
    T[tot].par =
        (T[ff].par > 1 && T[tot].len - T[ff].len == T[ff].len - T[T[ff].fa].len)
            ? T[ff].par
            : tot;
  }
  lst = T[lst].ch[x];
  f[pos] = INF;
  for (int i = lst; i > 1; i = T[T[i].par].fa) {
    int pa = T[i].par, fa = T[i].fa;
    remf[i] = f[pos - T[pa].len], reg[i] = pos - T[pa].len;
    if (i != pa && remf[i] > remf[fa]) remf[i] = remf[fa], reg[i] = reg[fa];
    if ((~pos & 1) && f[pos] > remf[i] + 1)
      f[pos] = remf[i] + 1, g[pos] = reg[i];
  }
  if ((~pos & 1) && S[pos] == S[pos - 1] && f[pos] > f[pos - 2])
    f[pos] = f[pos - 2], g[pos] = pos - 2;
}
}  // namespace SAM
int main(void) {
  scanf("%s%s", s, t);
  int n = strlen(s);
  for (int i = 0; i < n; i++) S[i << 1 | 1] = s[i], S[(i + 1) << 1] = t[i];
  n <<= 1;
  S[0] = 'a' - 1;
  SAM::Init();
  for (int i = 1; i <= n; i++) {
    SAM::Append(i, S[i] - 'a');
  }
  if (f[n] == INF) return puts("-1"), 0;
  printf("%d\n", f[n]);
  for (int x = n; x; x = g[x])
    if (x - g[x] > 2) printf("%d %d\n", (g[x] >> 1) + 1, x >> 1);
  return 0;
}