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 N = 1e6 + 10;
char s1[N], s2[N], s[N];
int n, lst, nod, len[N], fail[N], diff[N], anc[N], ch[N][26];
int f[N], pos[N], pre[N];
void init() {
  fail[0] = fail[1] = nod = 1;
  len[1] = -1;
}
void extend(int c, int i) {
  int p = lst;
  while (s[i - len[p] - 1] != s[i]) p = fail[p];
  if (!ch[p][c]) {
    int x = ++nod, k = fail[p];
    while (s[i - len[k] - 1] != s[i]) k = fail[k];
    fail[x] = ch[k][c];
    ch[p][c] = x;
    len[x] = len[p] + 2;
    diff[x] = len[x] - len[fail[x]];
    anc[x] = (diff[x] == diff[fail[x]]) ? anc[fail[x]] : fail[x];
  }
  lst = ch[p][c];
}
int main() {
  scanf("%s%s", s1 + 1, s2 + 1);
  n = strlen(s1 + 1);
  init();
  for (int i = 1; i <= n * 2; i++) s[i] = (i & 1) ? s1[(i + 1) / 2] : s2[i / 2];
  for (int i = 1; i <= n * 2; i++) f[i] = 1e9;
  for (int i = 1; i <= n * 2; i++) {
    extend(s[i] - 'a', i);
    for (int k = lst; k; k = anc[k]) {
      pos[k] = i - len[anc[k]] - diff[k];
      if (anc[k] != fail[k] && f[pos[fail[k]]] < f[pos[k]])
        pos[k] = pos[fail[k]];
      if (!(i & 1) && f[i] > f[pos[k]] + 1)
        f[i] = f[pos[k]] + 1, pre[i] = pos[k];
    }
    if (!(i & 1) && s[i] == s[i - 1] && f[i - 2] <= f[i])
      f[i] = f[i - 2], pre[i] = i - 2;
  }
  if (f[n * 2] >= 1e9) return puts("-1"), 0;
  printf("%d\n", f[n * 2]);
  for (int i = n * 2; i; i = pre[i])
    if (i - pre[i] > 2) printf("%d %d\n", pre[i] / 2 + 1, i >> 1);
}