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;
namespace FGF {
int n, m;
const int N = 1e6 + 5;
char s[N], a[N], b[N];
int dif[N], sl[N], tot, len[N], dp[N], fai[N], lst, g[N], pre[N], ans[N],
    nxt[N][26];
int getfail(int x, int y) {
  while (s[y - len[x] - 1] != s[y]) x = fai[x];
  return x;
}
void inser(int x, int y) {
  int pos = getfail(lst, y);
  if (!nxt[pos][x]) {
    len[++tot] = len[pos] + 2;
    fai[tot] = nxt[getfail(fai[pos], y)][x];
    nxt[pos][x] = tot;
    dif[tot] = len[tot] - len[fai[tot]];
    if (dif[tot] == dif[fai[tot]])
      sl[tot] = sl[fai[tot]];
    else
      sl[tot] = fai[tot];
  }
  lst = nxt[pos][x];
}
void work() {
  scanf("%s%s", a + 1, b + 1);
  n = strlen(a + 1);
  for (int i = 1, cnt = 0; i <= n; i++) s[++cnt] = a[i], s[++cnt] = b[i];
  n *= 2;
  memset(dp, 0x3f, sizeof(dp)), memset(g, 0x3f, sizeof(g));
  s[0] = '#', tot = 1, len[1] = -1, dp[0] = 0, g[0] = 0, fai[0] = 1;
  for (int i = 1; i <= n; i++) {
    inser(s[i] - 'a', i);
    for (int x = lst; x; x = sl[x]) {
      g[x] = dp[i - dif[x] - len[sl[x]]], pre[x] = i - dif[x] - len[sl[x]];
      if (dif[x] == dif[fai[x]] && g[fai[x]] < g[x])
        g[x] = g[fai[x]], pre[x] = pre[fai[x]];
      if (i % 2 == 0 && g[x] + 1 < dp[i]) dp[i] = g[x] + 1, ans[i] = pre[x];
      if (i % 2 == 0 && s[i] == s[i - 1] && dp[i - 2] < dp[i])
        dp[i] = dp[i - 2], ans[i] = i - 2;
    }
  }
  if (dp[n] >= 0x3f3f3f3f) {
    puts("-1");
    return;
  }
  printf("%d\n", dp[n]);
  for (int x = n; x; x = ans[x])
    if (x - ans[x] != 2) printf("%d %d\n", ans[x] / 2 + 1, x / 2);
}
}  // namespace FGF
int main() {
  FGF::work();
  return 0;
}