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;
int n, all, last, c[26][1000005], fail[1000005], len[1000005], half[1000005],
    dif[1000005], slink[1000005], f[1000005], g[1000005], sum[1000005],
    pre[1000005], pg[1000005];
char s[1000005], str[1000005];
void inti() {
  all = last = 1;
  fail[0] = 1;
  len[1] = -1;
}
void attend(int p, int x) {
  int pos = last;
  while (s[p] != s[p - len[pos] - 1]) pos = fail[pos];
  if (!c[x][pos]) {
    len[++all] = len[pos] + 2;
    int k = fail[pos];
    while (s[p] != s[p - len[k] - 1]) k = fail[k];
    fail[all] = c[x][k], c[x][pos] = all;
    if (len[pos] > 1) {
      k = half[pos];
      while (s[p] != s[p - len[k] - 1] || len[k] + 2 > len[all] / 2)
        k = fail[k];
      half[all] = c[x][k];
    }
    dif[all] = len[all] - len[fail[all]];
    if (dif[all] == dif[fail[all]])
      slink[all] = slink[fail[all]];
    else
      slink[all] = fail[all];
  }
  last = c[x][pos];
}
int main() {
  scanf("%s", str + 1);
  n = strlen(str + 1);
  scanf("%s", str + n + 1);
  reverse(str + n + 1, str + n + n + 1);
  n <<= 1;
  for (int i = 1; i <= n; i += 2) s[i] = str[i + 1 >> 1];
  for (int i = 2; i <= n; i += 2) s[i] = str[n - i / 2 + 1];
  for (int i = 2; i <= n; i += 2) sum[i] = sum[i - 2] + (s[i] != s[i - 1]);
  inti();
  for (int i = 1; i <= n; ++i) {
    attend(i, s[i] - 'a');
    f[i] = 1e9;
    if (!(i & 1) && s[i] == s[i - 1]) f[i] = f[i - 2], pre[i] = i - 2;
    for (int x = last; x > 1; x = slink[x]) {
      pg[x] = i - len[slink[x]] - dif[x];
      if (dif[x] == dif[fail[x]] && f[pg[x]] > f[pg[fail[x]]])
        pg[x] = pg[fail[x]];
      if (!(i & 1) && f[i] > f[pg[x]] + 1) f[i] = f[pg[x]] + 1, pre[i] = pg[x];
    }
  }
  if (f[n] == 1e9)
    puts("-1");
  else {
    cout << f[n] << '\n';
    for (int i = n; i; i = pre[i])
      if (i - pre[i] != 2) cout << pre[i] / 2 + 1 << ' ' << i / 2 << '\n';
  }
}