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;
int n, i, p, id, L[1111111], F[1111111], c[1111111][26], df[1111111],
    sk[1111111], f[1111111], _f[1111111], pre[1111111];
char s[1111111], A[1111111], B[1111111];
void add(int z, int n) {
  for (; s[n - L[p] - 1] != s[n]; p = F[p])
    ;
  if (!c[p][z]) {
    int q = ++id, k = F[p];
    L[q] = L[p] + 2;
    for (; s[n - L[k] - 1] != s[n]; k = F[k])
      ;
    F[q] = c[k][z];
    c[p][z] = q;
    df[q] = L[q] - L[F[q]];
    sk[q] = (df[q] == df[F[q]] ? sk[F[q]] : F[q]);
  }
  p = c[p][z];
}
int main() {
  scanf("%s%s", A + 1, B + 1);
  n = strlen(A + 1);
  for (int i = 1; i <= n; i++) s[i * 2 - 1] = A[i], s[i * 2] = B[i];
  id = F[0] = 1;
  L[1] = -1;
  n *= 2;
  _f[0] = 1;
  for (int i = 1; i <= n; i++) f[i] = 1e9;
  for (int i = 1; i <= n; i++) {
    add(s[i] - 'a', i);
    for (int x = p; x; x = sk[x]) {
      _f[x] = i - L[sk[x]] - df[x];
      if (df[F[x]] == df[x] && f[_f[x]] > f[_f[F[x]]]) _f[x] = _f[F[x]];
      if (i % 2 == 0 && f[i] > f[_f[x]] + 1)
        f[i] = f[_f[x]] + 1, pre[i] = _f[x];
    }
    if (i % 2 == 0 && s[i] == s[i - 1] && f[i] > f[i - 2])
      f[i] = f[i - 2], pre[i] = i - 2;
  }
  if (f[n] == 1e9) return puts("-1"), 0;
  printf("%d\n", f[n]);
  for (i = n; i; i = pre[i])
    if (i - pre[i] > 2) printf("%d %d\n", pre[i] / 2 + 1, i / 2);
}