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;
inline int gi() {
  register int data = 0, fu = 1;
  register char ch = getchar();
  while (ch != '-' && (ch < '0' || ch > '9')) ch = getchar();
  if (ch == '-') fu = -1, ch = getchar();
  while ('0' <= ch && ch <= '9')
    data = (data << 1) + (data << 3) + (ch ^ 48), ch = getchar();
  return fu * data;
}
const int inf = 1000000007;
int f[1000005], g[1000005], h[1000005], pre[1000005], ch[1000005][27],
    fail[1000005], len[1000005], delta[1000005], top[1000005];
int n, m;
char s1[1000005], s2[1000005], s[1000005];
int oo, last;
inline void Init() {
  for (int i = 0; i <= oo; i++) memset(ch[i], 0, sizeof(ch[i])), fail[i] = 0;
  oo = 1;
  g[0] = g[1] = inf;
  delta[0] = delta[1] = inf;
  fail[1] = fail[0] = 1;
  len[0] = 0;
  len[oo] = -1;
  last = 0;
  return;
}
inline void Extend(int ps, int c) {
  int p = last, cl;
  while (s[ps - len[p] - 1] != s[ps]) p = fail[p];
  if (!ch[p][c]) {
    cl = fail[p];
    while (s[ps - len[cl] - 1] != s[ps]) cl = fail[cl];
    ++oo;
    len[oo] = len[p] + 2;
    fail[oo] = ch[cl][c];
    g[oo] = inf;
    ch[p][c] = oo;
  }
  last = ch[p][c];
  delta[last] = len[last] - len[fail[last]];
  top[last] = (delta[last] == delta[fail[last]]) ? top[fail[last]] : last;
  return;
}
inline void Work() {
  scanf("%s", s1 + 1);
  scanf("%s", s2 + 1);
  n = strlen(s1 + 1);
  for (int i = 1; i <= n; i++) s[2 * i - 1] = s1[i], s[2 * i] = s2[i];
  n <<= 1;
  for (int i = 1; i <= n; i++) f[i] = inf;
  f[0] = 0;
  Init();
  for (int i = 1; i <= n; i++) {
    Extend(i, s[i] - 'a');
    int x = last;
    while (x > 1) {
      g[x] = delta[fail[x]] == delta[x] ? g[fail[x]] : inf;
      h[x] = delta[fail[x]] == delta[x] ? h[fail[x]] : inf;
      g[x] = min(g[x], f[i - len[top[x]]] + 1);
      if (g[x] == f[i - len[top[x]]] + 1) h[x] = i - len[top[x]];
      f[i] = min(f[i], g[x]);
      if (f[i] == g[x]) pre[i] = h[x];
      x = fail[top[x]];
    }
    if (i & 1)
      f[i] = inf;
    else if (s[i] == s[i - 1]) {
      f[i] = min(f[i], f[i - 2]);
      if (f[i] == f[i - 2]) pre[i] = -1;
    }
  }
  if (f[n] == inf)
    puts("-1");
  else {
    printf("%d\n", f[n]);
    int x = n;
    while (x) {
      if (pre[x] == -1)
        x -= 2;
      else
        printf("%d %d\n", (pre[x] / 2) + 1, x / 2), x = pre[x];
    }
  }
  return;
}
int main() {
  m = 17;
  Work();
  return 0;
}