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;
inline int read() {
  int x = 0;
  bool t = false;
  char ch = getchar();
  while ((ch < '0' || ch > '9') && ch != '-') ch = getchar();
  if (ch == '-') t = true, ch = getchar();
  while (ch <= '9' && ch >= '0') x = x * 10 + ch - 48, ch = getchar();
  return t ? -x : x;
}
char A[1000100], B[1000100], s[1000100];
int f[1000100], g[1000100], tr[1000100], n;
struct Node {
  int son[26], ff, len;
  void clear() {
    ff = len = 0;
    memset(son, 0, sizeof(son));
  }
} t[1000100];
int last, tot, diff[1000100], anc[1000100];
void extend(int c, int n, char *s) {
  int p = last;
  while (s[n] != s[n - t[p].len - 1]) p = t[p].ff;
  if (!t[p].son[c]) {
    int v = ++tot, k = t[p].ff;
    t[v].len = t[p].len + 2;
    while (s[n] != s[n - t[k].len - 1]) k = t[k].ff;
    t[v].ff = t[k].son[c];
    t[p].son[c] = v;
    diff[v] = t[v].len - t[t[v].ff].len;
    anc[v] = diff[v] == diff[t[v].ff] ? anc[t[v].ff] : t[v].ff;
  }
  last = t[p].son[c];
}
int Min(int x, int y) {
  if (x == -1) return y;
  if (y == -1) return x;
  return f[x] < f[y] ? x : y;
}
int main() {
  scanf("%s", A + 1);
  scanf("%s", B + 1);
  n = 0;
  t[tot = 1].len = -1;
  t[0].ff = t[1].ff = 1;
  anc[0] = 1;
  last = 0;
  for (int i = 1, l = strlen(A + 1); i <= l; ++i) s[++n] = A[i], s[++n] = B[i];
  for (int i = 0; i <= n + 1; ++i) g[i] = -1;
  for (int i = 1; i <= n; ++i) {
    f[i] = 1e9;
    if (i > 1 && s[i] == s[i - 1]) f[i] = min(f[i], f[i - 2]), tr[i] = i - 2;
    extend(s[i] - 97, i, s);
    for (int k = last; k; k = anc[k]) {
      g[k] = i - t[anc[k]].len - diff[k];
      if (anc[k] != t[k].ff) g[k] = Min(g[k], g[t[k].ff]);
      if ((~g[k]) && f[g[k]] + 1 < f[i] && (~i & 1))
        f[i] = f[g[k]] + 1, tr[i] = g[k];
    }
  }
  if (f[n] >= 1e9)
    puts("-1");
  else {
    printf("%d\n", f[n]);
    for (int i = n; i; i = tr[i])
      if (tr[i] != i - 2) printf("%d %d\n", (tr[i] >> 1) + 1, i >> 1);
  }
  return 0;
}