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>
inline int in() {
  int k = 0;
  char ch = getchar();
  while (ch < '-') ch = getchar();
  while (ch > '-') k = k * 10 + ch - '0', ch = getchar();
  return k;
}
const int N = 1e6 + 5, inf = 1e9;
int ch[N][26], fa[N], len[N], anc[N], dif[N], tot, lst, p, np, pr[N];
char str[N];
inline void init() {
  for (int i = 0; i <= tot; ++i)
    memset(ch[i], len[i] = fa[i] = 0, sizeof ch[i]);
  fa[0] = fa[1] = 1, len[tot = 1] = -1, anc[0] = 1, lst = 0;
}
inline void extend(int c, int n) {
  p = lst;
  while (str[n] != str[n - len[p] - 1]) p = fa[p];
  if (!ch[p][c]) {
    len[np = ++tot] = len[p] + 2;
    int k = fa[p];
    while (str[n] != str[n - len[k] - 1]) k = fa[k];
    fa[np] = ch[k][c], ch[p][c] = np;
    dif[np] = len[np] - len[fa[np]];
    anc[np] = dif[np] == dif[fa[np]] ? anc[fa[np]] : fa[np];
  }
  lst = ch[p][c];
}
int f[N], g[N];
inline int cmp(const int &x, const int &y) {
  if (x == -1) return y;
  if (y == -1) return x;
  return f[x] < f[y] ? x : y;
}
inline void work() {
  static char A[N], B[N];
  scanf("%s%s", A + 1, B + 1);
  int n = 0;
  for (int i = 1, l = strlen(A + 1); i <= l; ++i)
    str[++n] = A[i], str[++n] = B[i];
  memset(g, -1, n + 2 << 2);
  for (int i = 1; i <= n; ++i) {
    f[i] = inf;
    extend(str[i] - 'a', i);
    if (i > 1 && str[i] == str[i - 1]) f[i] = f[i - 2], pr[i] = i - 2;
    for (int k = lst; k; k = anc[k]) {
      g[k] = i - len[anc[k]] - dif[k];
      if (anc[k] != fa[k]) g[k] = cmp(g[k], g[fa[k]]);
      if (g[k] == -1 || (i & 1)) continue;
      if (f[g[k]] + 1 < f[i]) f[i] = f[g[k]] + 1, pr[i] = g[k];
    }
  }
  if (f[n] >= inf)
    puts("-1");
  else {
    printf("%d\n", f[n]);
    for (int i = n; i; i = pr[i])
      if (pr[i] != i - 2) printf("%d %d\n", (pr[i] >> 1) + 1, i >> 1);
  }
}
int main() {
  for (int t = 1; t; --t) init(), work();
  return 0;
}