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>
int len[1000010], son[1000010][26], nxt[1000010],
    cnt = 1, last, n, pre[1000010], pos[1000010], fa[1000010], diff[1000010],
    faz[1000010];
int an[1000010];
char str1[1000010], str2[1000010], s[1000010];
std::vector<int> ans;
int getnxt(int x) {
  while (s[n] != s[n - len[x] - 1]) x = nxt[x];
  return x;
}
void add(int x) {
  ++n;
  int cur = getnxt(last);
  if (!son[cur][x]) {
    len[++cnt] = len[cur] + 2;
    nxt[cnt] = son[getnxt(nxt[cur])][x];
    son[cur][x] = cnt;
    diff[cnt] = len[cnt] - len[nxt[cnt]];
    an[cnt] = (diff[cnt] == diff[nxt[cnt]]) ? an[nxt[cnt]] : nxt[cnt];
  }
  last = son[cur][x];
}
struct info {
  int v, p;
} f[1000010], g[1000010];
void upd(info &a, info b) {
  if (a.v > b.v) a = b;
}
int main() {
  scanf("%s%s", str1 + 1, str2 + 1);
  int len = strlen(str1 + 1);
  for (int i = 1; i <= len; i++) s[(i << 1) - 1] = str1[i], s[i << 1] = str2[i];
  len <<= 1;
  nxt[0] = 1, ::len[1] = -1;
  s[0] = -1;
  for (int i = 1; i <= len; i++) f[i].v = 0x7f7f7f7f;
  for (int i = 0; i <= cnt; i++) g[i].v = 0x7f7f7f7f;
  f[0].v = 0;
  for (int i = 1; i <= len; i++) {
    add(s[i] - 'a');
    if (s[i] == s[i - 1] && i > 1) upd(f[i], (info){f[i - 2].v, 2});
    for (int j = last; j; j = an[j]) {
      g[j].v = 0x7f7f7f7f;
      if (an[j] != nxt[j])
        upd(g[j], (info){g[nxt[j]].v, g[nxt[j]].p + diff[j]});
      upd(g[j],
          (info){f[i - ::len[an[j]] - diff[j]].v + 1, ::len[an[j]] + diff[j]});
      upd(f[i], g[j]);
    }
    if (i % 2) f[i].v = 0x7f7f7f7f;
  }
  if (f[len].v > len)
    puts("-1");
  else {
    int tem = len;
    while (tem) {
      if (f[tem].p > 2) ans.push_back(tem);
      tem -= f[tem].p;
    }
    printf("%d\n", ans.size());
    for (int i = 0; i < ans.size(); i++)
      printf("%d %d\n", ((ans[i] - f[ans[i]].p) >> 1) + 1, (ans[i] >> 1));
  }
}