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 + 100;
int n, f[N], pre[N], g[N], fa[N], ch[N][26], len[N], anc[N], diff[N], tot, las;
char S[N], T[N], str[N];
void extend(int c, int x) {
  int p = las;
  while (str[x - len[p] - 1] != str[x]) p = fa[p];
  if (!ch[p][c]) {
    int np = ++tot, k = fa[p];
    len[np] = len[p] + 2;
    while (str[x - len[k] - 1] != str[x]) k = fa[k];
    fa[np] = ch[k][c], ch[p][c] = np;
    diff[np] = len[np] - len[fa[np]];
    anc[np] = diff[np] == diff[fa[np]] ? anc[fa[np]] : fa[np];
  }
  las = ch[p][c];
}
void work(int pos) {
  if (pos <= 0) return;
  if (pre[pos] == pos - 2) return work(pos - 2);
  return printf("%d %d\n", (pre[pos] + 2) / 2, pos / 2), work(pre[pos]);
}
int main() {
  scanf("%s", S + 1), scanf("%s", T + 1);
  if (strlen(S + 1) != strlen(T + 1)) {
    puts("-1");
    return 0;
  }
  n = strlen(S + 1);
  for (int i = 1; i <= n; ++i) str[2 * i - 1] = S[i];
  for (int i = 1; i <= n; ++i) str[2 * i] = T[i];
  n <<= 1;
  for (int i = 1; i <= n + 2; ++i) f[i] = 1e9;
  str[0] = '~', las = 0, tot = 1, anc[0] = fa[0] = fa[1] = 1, len[1] = -1;
  f[0] = 0;
  for (int i = 1; i <= n; ++i) {
    extend(str[i] - 'a', i);
    for (int k = las; k; k = anc[k]) {
      g[k] = i - len[anc[k]] - diff[k];
      if (anc[k] != fa[k]) g[k] = f[g[k]] < f[g[fa[k]]] ? g[k] : g[fa[k]];
      if (i & 1) continue;
      if (f[i] > f[g[k]] + 1) f[i] = f[g[k]] + 1, pre[i] = g[k];
    }
    if (i > 1 && str[i] == str[i - 1] && f[i] > f[i - 2])
      f[i] = f[i - 2], pre[i] = i - 2;
  }
  if (f[n] == f[n + 1]) {
    puts("-1");
    return 0;
  }
  printf("%d\n", f[n]), work(n);
  return 0;
}