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 maxn = 1e6 + 10, oo = 1e9;
char s[maxn], t[maxn];
int n, f[maxn], g[maxn], m, len[maxn], par[maxn], anc[maxn], remf[maxn],
    remg[maxn], go[maxn][26];
int main() {
  scanf("%s", t);
  n = strlen(t);
  for (int i = 0; i < n; ++i) s[(i << 1) | 1] = t[i];
  scanf("%s", t);
  for (int i = 0; i < n; ++i) s[i + 1 << 1] = t[i];
  n <<= 1;
  len[0] = -(m = 1);
  remf[0] = remf[1] = oo;
  anc[0] = 0;
  anc[1] = 1;
  for (int lst = 0, i = 1; i <= n; ++i) {
    f[i] = oo;
    while (s[i - len[lst] - 1] != s[i]) lst = par[lst];
    if (!go[lst][s[i] - 'a']) {
      go[lst][s[i] - 'a'] = ++m;
      len[m] = len[lst] + 2;
      if (!lst)
        par[m] = 1;
      else {
        int x = par[lst];
        while (s[i - len[x] - 1] != s[i]) x = par[x];
        par[m] = go[x][s[i] - 'a'];
      }
      anc[m] = ((par[m] > 1 &&
                 len[m] - len[par[m]] == len[par[m]] - len[par[par[m]]])
                    ? anc[par[m]]
                    : m);
    }
    lst = go[lst][s[i] - 'a'];
    for (int u = lst; u > 1; u = par[anc[u]]) {
      remf[u] = f[i - len[anc[u]]];
      remg[u] = i - len[anc[u]];
      if (anc[u] != u && remf[par[u]] < remf[u])
        remf[u] = remf[par[u]], remg[u] = remg[par[u]];
      if ((~i & 1) && f[i] > remf[u] + 1) f[i] = remf[u] + 1, g[i] = remg[u];
    }
    if ((~i & 1) && s[i - 1] == s[i] && f[i - 2] < f[i])
      f[i] = f[i - 2], g[i] = i - 2;
  }
  if (f[n] == oo) {
    puts("-1");
    return 0;
  }
  printf("%d\n", f[n]);
  for (int i = n; i; i = g[i]) {
    if (i - g[i] > 2) printf("%d %d\n", (g[i] >> 1) + 1, i >> 1);
  }
  return 0;
}