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 = int(5e5) + 100;
const int inf = 0x3fffffff;
int n, m;
int total;
char st[maxn], str[maxn];
int son[maxn * 2][26];
int len[maxn * 2], a[maxn * 2], S[maxn * 2], fail[maxn * 2], diff[maxn * 2],
    anc[maxn * 2];
int hd[maxn * 2], ans[maxn * 2], path[maxn * 2];
int last;
void read() {
  gets(st);
  gets(str);
  int len = strlen(st);
  for (int i = 0; i < len; ++i) {
    a[++n] = st[i] - 'a';
    a[++n] = str[i] - 'a';
  }
}
void init() {
  S[0] = -1;
  m = 0;
  total = 1;
  last = 0;
  len[0] = 0;
  len[1] = -1;
  fail[0] = 1;
  fail[1] = 0;
}
void insert(int ch) {
  S[++m] = ch;
  int cur = last;
  while (S[m - len[cur] - 1] != S[m]) cur = fail[cur];
  if (!son[cur][ch]) {
    len[++total] = len[cur] + 2;
    int tmp = fail[cur];
    while (S[m - len[tmp] - 1] != S[m]) tmp = fail[tmp];
    tmp = son[tmp][ch];
    fail[total] = tmp;
    son[cur][ch] = total;
    diff[total] = len[total] - len[tmp];
    anc[total] = (diff[total] == diff[tmp] ? anc[tmp] : tmp);
  }
  last = son[cur][ch];
}
void solve() {
  init();
  for (int i = 1; i <= n; ++i) ans[i] = inf;
  for (int i = 1; i <= n; ++i) {
    insert(a[i]);
    for (int j = last; j; j = anc[j]) {
      hd[j] = i - len[anc[j]] - diff[j];
      if (anc[j] != fail[j] && ans[hd[fail[j]]] < ans[hd[j]])
        hd[j] = hd[fail[j]];
      if (!(i & 1) && ans[hd[j]] + 1 < ans[i]) {
        ans[i] = ans[hd[j]] + 1;
        path[i] = hd[j];
      }
    }
    if (!(i & 1) && a[i] == a[i - 1] && ans[i - 2] < ans[i]) {
      ans[i] = ans[i - 2];
      path[i] = i - 2;
    }
  }
  if (ans[n] < inf) {
    printf("%d\n", ans[n]);
    for (int i = n; i; i = path[i])
      if (path[i] + 2 < i) printf("%d %d\n", path[i] / 2 + 1, i / 2);
  } else
    printf("-1\n");
}
int main() {
  read();
  solve();
  return 0;
}