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 + 5;
int ch[N][26], fa[N], len[N], ct, last;
int diff[N], anc[N];
void extend(int, int);
pair<int, int> series[N];
int ans[N], pre[N];
char s[N], t[N];
char str[N];
int main() {
  scanf("%s%s", s + 1, t + 1);
  int n = strlen(s + 1);
  int m = 0;
  for (int i = 1; i <= n; i++) {
    str[++m] = s[i], str[++m] = t[i];
  }
  for (int i = 1; i <= m; i++) s[i] = str[i];
  memset(ans, 0x3f, sizeof(ans));
  ans[0] = 0;
  ct = last = fa[0] = fa[1] = 1, len[1] = -1;
  for (int i = 1; i <= m; i++) {
    extend(s[i] - 'a', i);
    for (int u = last; u > 1; u = fa[anc[u]]) {
      series[u] = pair<int, int>(ans[i - len[anc[u]]], i - len[anc[u]]);
      if (diff[u] == diff[fa[u]]) series[u] = min(series[u], series[fa[u]]);
      if (i % 2 == 0 && ans[i] > series[u].first + 1) {
        ans[i] = series[u].first + 1;
        pre[i] = series[u].second;
      }
    }
    if (i > 1 && s[i] == s[i - 1] && ans[i] > ans[i - 2]) {
      ans[i] = ans[i - 2];
      pre[i] = i - 2;
    }
  }
  if (ans[m] > m / 2)
    puts("-1");
  else {
    printf("%d\n", ans[m]);
    int u = m;
    while (u) {
      int v = pre[u];
      if (u - v > 2) printf("%d %d\n", v / 2 + 1, u / 2);
      u = v;
    }
  }
}
void extend(int c, int i) {
  int p = last;
  while (s[i - len[p] - 1] != s[i]) p = fa[p];
  if (!ch[p][c]) {
    int np = ++ct, q = fa[p];
    while (s[i - len[q] - 1] != s[i]) q = fa[q];
    fa[np] = ch[q][c], ch[p][c] = np;
    len[np] = len[p] + 2;
    diff[np] = len[np] - len[fa[np]];
    anc[np] = diff[np] == diff[fa[np]] ? anc[fa[np]] : np;
  }
  last = ch[p][c];
}