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 re = 0, flag = 1;
  char ch = getchar();
  while (!isdigit(ch)) {
    if (ch == '-') flag = -1;
    ch = getchar();
  }
  while (isdigit(ch)) re = (re << 1) + (re << 3) + ch - '0', ch = getchar();
  return re * flag;
}
int n;
char t1[500010], t2[500010], s[1000010];
namespace pam {
int last, cnt, fail[1000010], len[1000010], ch[1000010][26], anc[1000010];
int val[1000010], pos[1000010], tval[1000010], tpos[1000010];
inline int newnode(int w) {
  len[++cnt] = w;
  return cnt;
}
void init() {
  s[0] = -1;
  last = 0;
  cnt = -1;
  fail[0] = 1;
  newnode(0);
  newnode(-1);
  anc[0] = 0;
  anc[1] = 1;
  tval[0] = tval[1] = 1e9;
}
inline int getfail(int cur, int pos) {
  while (s[pos - len[cur] - 1] != s[pos]) cur = fail[cur];
  return cur;
}
inline void insert(int x) {
  int c = s[x] - 'a', cur = getfail(last, x);
  val[x] = 1e9;
  if (!ch[cur][c]) {
    int now = newnode(len[cur] + 2);
    fail[now] = ch[getfail(fail[cur], x)][c];
    ch[cur][c] = now;
    anc[now] = ((fail[now] > 1 && len[now] - len[fail[now]] ==
                                      len[fail[now]] - len[fail[fail[now]]])
                    ? anc[fail[now]]
                    : now);
  }
  last = ch[cur][c];
  for (cur = ch[cur][c]; cur > 1; cur = fail[anc[cur]]) {
    tval[cur] = val[x - len[anc[cur]]];
    tpos[cur] = x - len[anc[cur]];
    if (anc[cur] != cur && tval[fail[cur]] < tval[cur])
      tval[cur] = tval[fail[cur]], tpos[cur] = tpos[fail[cur]];
    if ((x % 2 == 0) && (val[x] > tval[cur] + 1))
      val[x] = tval[cur] + 1, pos[x] = tpos[cur];
  }
  if (x % 2 == 0 && s[x - 1] == s[x] && val[x - 2] < val[x])
    val[x] = val[x - 2], pos[x] = x - 2;
}
}  // namespace pam
int main() {
  scanf("%s", t1 + 1);
  scanf("%s", t2 + 1);
  n = strlen(t1 + 1);
  int i;
  for (i = 1; i <= n; i++) {
    s[i * 2 - 1] = t1[i];
    s[i * 2] = t2[i];
  }
  using namespace pam;
  n <<= 1;
  init();
  for (i = 1; i <= n; i++) insert(i);
  if (val[n] == 1e9)
    puts("-1");
  else {
    printf("%d\n", val[n]);
    for (i = n; i; i = pos[i]) {
      if (i - pos[i] > 2) printf("%d %d\n", (pos[i] >> 1) + 1, i >> 1);
    }
  }
}