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>
const int maxn = 500010, inf = 1 << 30;
int n, f[maxn], g[maxn];
char s[maxn * 2], t[maxn];
struct seg {
  int x, d, n, f, g;
} a[50], b[50], tmp[maxn];
bool cmin(int& a, int b) { return b < a ? a = b, 1 : 0; }
int main() {
  scanf("%s%s", s, t);
  while (s[n]) n++;
  for (int i = n; i--;) s[i * 2 + 1] = t[i], s[i * 2] = s[i];
  seg* ar = a;
  *a = (seg){1, 0, 0, inf};
  for (int i = 2; i <= n * 2; i++) {
    seg* br = b;
    int la = i;
    *b = (seg){i, 0, 0, inf};
    for (seg* j = a; j <= ar; j++)
      if (j->x && s[j->x - 1] == s[i - 1]) {
        if (!br->n) br->d = la - j->x + 1;
        if (la - j->x + 1 == br->d)
          br->n++;
        else
          br[1] = (seg){la, la - j->x + 1, 1, inf}, ++br;
        if (j->n > 1) {
          if (br->d == j->d)
            br->n += j->n - 1;
          else
            br[1] = (seg){j->x - 1, j->d, j->n - 1, inf}, ++br;
        }
        la = br->x - br->d * br->n;
      }
    if (br->n) br[1] = (seg){br->x - br->n * br->d, 0, 0, inf}, ++br;
    ar = a;
    if (i % 2)
      for (seg* j = b; j < br; j++) *ar++ = *j;
    else {
      f[i / 2] = s[i - 2] == s[i - 1] ? f[i / 2 - 1] : inf;
      g[i / 2] = i / 2 - 1;
      for (seg* j = b; j < br; j++) {
        int l = j->x - j->d * j->n >> 1;
        if (j->n == 1) j->f = f[l], j->g = l;
        if (j->n > 1) {
          j->f = tmp[l].f;
          j->g = tmp[l].g;
          if (tmp[l].d != j->d)
            puts("WA");
          else if (tmp[l].n == j->n - 1)
            cmin(j->f, f[j->x - j->d >> 1]) ? j->g = j->x - j->d >> 1 : 1;
          else if (tmp[l].n != j->n)
            puts("WA");
        }
        tmp[l] = *ar++ = *j;
        if (cmin(f[i / 2], j->f + 1)) g[i / 2] = j->g;
      }
    }
    *ar = *br;
  }
  if (f[n] < inf) {
    printf("%d\n", f[n]);
    for (int i = n; i;) {
      if (f[i] == f[i - 1] && g[i] == i - 1)
        i--;
      else
        printf("%d %d\n", g[i] + 1, i), i = g[i];
    }
  } else
    puts("-1");
}