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;
template <typename T>
inline void upmin(T &x, T y) {
  y < x ? x = y : 0;
}
template <typename T>
inline void upmax(T &x, T y) {
  x < y ? x = y : 0;
}
const long double pi = acos(-1);
const int oo = 1 << 30;
const long long OO = 1e18;
const int N = 1e6 + 200;
int gi() {
  int w = 0;
  bool q = 1;
  char c = getchar();
  while ((c < '0' || c > '9') && c != '-') c = getchar();
  if (c == '-') q = 0, c = getchar();
  while (c >= '0' && c <= '9') w = w * 10 + c - '0', c = getchar();
  return q ? w : -w;
}
char s1[N], s2[N];
int s[N], ans[N], fr[N], f[N];
int son[N][26], fail[N], len[N], tot, last;
int anc[N], dif[N];
inline int add(int p, int k) {
  while (s[k] != s[k - len[p] - 1]) p = fail[p];
  if (!son[p][s[k]]) {
    len[++tot] = len[p] + 2;
    int t = fail[p];
    while (s[k] != s[k - len[t] - 1]) t = fail[t];
    fail[tot] = t = son[t][s[k]], son[p][s[k]] = tot;
    dif[tot] = len[tot] - len[t], anc[tot] = dif[tot] == dif[t] ? anc[t] : t;
  }
  return son[p][s[k]];
}
int main() {
  scanf("%s", s1 + 1);
  scanf("%s", s2 + 1);
  int n = strlen(s1 + 1), i, k;
  s[0] = -1;
  for (i = 1; i <= n; i++) s[i * 2 - 1] = s1[i] - 'a', s[i * 2] = s2[i] - 'a';
  n <<= 1;
  last = 0, tot = 1, len[1] = -1, fail[0] = fail[1] = 1;
  memset(ans, 0x3f, sizeof(ans));
  ans[0] = 0;
  for (i = 1; i <= n; i++) {
    last = add(last, i);
    for (k = last; k; k = anc[k]) {
      f[k] = i - len[anc[k]] - dif[k];
      if (anc[k] != fail[k] && ans[f[fail[k]]] < ans[f[k]]) f[k] = f[fail[k]];
      if (!(i & 1) && ans[f[k]] + 1 < ans[i])
        ans[i] = ans[f[k]] + 1, fr[i] = f[k];
    }
    if (!(i & 1) && s[i - 1] == s[i] && ans[i - 2] < ans[i])
      ans[i] = ans[i - 2], fr[i] = i - 2;
  }
  if (ans[n] <= n) {
    printf("%d\n", ans[n]);
    for (i = n; i; i = fr[i])
      if (fr[i] + 2 < i) printf("%d %d\n", fr[i] / 2 + 1, i / 2);
  } else
    puts("-1");
  return 0;
}