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 mod = 1e9 + 7;
int n, f[1000005], pre[1000005], g[1000005];
char s[1000005], s2[1000005], t[1000005];
namespace PAM {
int fa[1000005] = {1, 1}, ch[1000005][26], len[1000005] = {0, -1}, last, sz = 1,
    anc[1000005], dif[1000005];
void extend(int x) {
  int p = last, c = s[x] - 'a';
  while (s[x] != s[x - len[p] - 1]) p = fa[p];
  if (!ch[p][c]) {
    int q = fa[p];
    len[++sz] = len[p] + 2;
    while (s[x] != s[x - len[q] - 1]) q = fa[q];
    fa[sz] = ch[q][c], dif[sz] = len[sz] - len[fa[sz]];
    anc[sz] = dif[sz] == dif[fa[sz]] ? anc[fa[sz]] : fa[sz];
    ch[p][c] = sz;
  }
  last = ch[p][c];
}
}  // namespace PAM
using namespace PAM;
bool chkmin(int &a, int b) { return a > b ? a = b, 1 : 0; }
int main() {
  scanf("%s%s", s + 1, t + 1), n = strlen(s + 1);
  for (int i = 1; i <= n; i++) s2[i * 2 - 1] = s[i], s2[i * 2] = t[i];
  n <<= 1, memcpy(s, s2, sizeof s2);
  memset(f, 0x3f, sizeof f), f[0] = 0;
  for (int i = 1; i <= n; i++) {
    extend(i);
    for (int x = last; x; x = anc[x]) {
      g[x] = i - len[anc[x]] - dif[x];
      if (anc[x] != fa[x] && f[g[fa[x]]] < f[g[x]]) g[x] = g[fa[x]];
      if (!(i & 1) && chkmin(f[i], f[g[x]] + (i - g[x] > 2))) pre[i] = g[x];
    }
  }
  if (f[n] > n)
    puts("-1");
  else {
    printf("%d\n", f[n]);
    for (int i = n; i; i = pre[i])
      if (pre[i] < i - 2) printf("%d %d\n", pre[i] / 2 + 1, i / 2);
  }
}