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>
void read(T &x) {
  x = 0;
  bool f = 0;
  char c = getchar();
  for (; !isdigit(c); c = getchar())
    if (c == '-') f = 1;
  for (; isdigit(c); c = getchar()) x = x * 10 + (c ^ 48);
  if (f) x = -x;
}
template <typename F>
inline void write(F x, char ed = '\n') {
  static short st[30];
  short tp = 0;
  if (x < 0) putchar('-'), x = -x;
  do st[++tp] = x % 10, x /= 10;
  while (x);
  while (tp) putchar('0' | st[tp--]);
  putchar(ed);
}
template <typename T>
inline void Mx(T &x, T y) {
  x < y && (x = y);
}
template <typename T>
inline void Mn(T &x, T y) {
  x > y && (x = y);
}
const int N = 1000250;
int ch[N][26], ans[N], len[N], g[N], f[N], Pr[N], pre[N];
int anc[N], dif[N];
int cnt = 1, las, n;
char s[N], t[N];
int getfail(int x, int c) {
  while (s[c - len[x] - 1] != s[c]) x = f[x];
  return x;
}
void insert(int c, int x) {
  int p = getfail(las, x);
  if (!ch[p][c]) {
    len[++cnt] = len[p] + 2;
    f[cnt] = ch[getfail(f[p], x)][c];
    dif[cnt] = len[cnt] - len[f[cnt]];
    if (dif[cnt] == dif[f[cnt]])
      anc[cnt] = anc[f[cnt]];
    else
      anc[cnt] = f[cnt];
    ch[p][c] = cnt;
  }
  las = ch[p][c];
}
int main() {
  scanf("%s", s + 1), scanf("%s", t + 1);
  int n = strlen(s + 1);
  for (int i = n; i >= 1; i--) s[i * 2 - 1] = s[i], s[i * 2] = t[i];
  n *= 2, f[0] = f[1] = 1, len[1] = -1;
  memset(ans, 0x3f, sizeof(ans));
  ans[0] = 0;
  memset(g, 0x3f, sizeof(g));
  for (int i = 1; i <= n; i++) {
    insert(s[i] - 'a', i);
    for (int k = las; k; k = anc[k]) {
      Pr[k] = i - len[anc[k]] - dif[k], g[k] = ans[Pr[k]] + 1;
      if (anc[k] != f[k] && g[f[k]] < g[k]) g[k] = g[f[k]], Pr[k] = Pr[f[k]];
      if (!(i & 1) && ans[i] > g[k]) pre[i] = Pr[k], ans[i] = g[k];
    }
    if (!(i & 1) && s[i] == s[i - 1] && ans[i - 2] < ans[i])
      ans[i] = ans[i - 2], pre[i] = i - 2;
  }
  if (ans[n] > n) return write(-1), 0;
  write(ans[n]);
  for (int nw = n; nw; nw = pre[nw])
    if (pre[nw] != nw - 2) write(pre[nw] / 2 + 1, ' '), write(nw / 2);
  return 0;
}