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 max(int x, int y) { return x > y ? x : y; }
inline int min(int x, int y) { return x < y ? x : y; }
inline int gcd(int n, int m) { return m ? gcd(m, n % m) : n; }
inline int lcm(int x, int y) { return x / gcd(x, y) * y; }
inline void swap(int &x, int &y) {
  int t = x;
  x = y;
  y = t;
  return;
}
namespace yspm {
inline int read() {
  int res = 0, f = 1;
  char k;
  while (!isdigit(k = getchar()))
    if (k == '-') f = -1;
  while (isdigit(k)) res = res * 10 + k - '0', k = getchar();
  return res * f;
}
const int N = 1e6 + 10;
char t1[N], t2[N], s[N];
int n, son[N][26], anc[N], len[N], fail[N], dlt[N], tot, lst;
inline void expand(int id) {
  int tmp = lst;
  while (s[id] != s[id - len[tmp] - 1]) tmp = fail[tmp];
  if (son[tmp][s[id] - 'a'])
    lst = son[tmp][s[id] - 'a'];
  else {
    int np = ++tot, y = fail[tmp];
    len[np] = len[tmp] + 2;
    while (s[id] != s[id - len[y] - 1]) y = fail[y];
    fail[np] = son[y][s[id] - 'a'];
    son[tmp][s[id] - 'a'] = lst = np;
    dlt[np] = len[np] - len[fail[np]];
    if (dlt[np] == dlt[fail[np]])
      anc[np] = anc[fail[np]];
    else
      anc[np] = fail[np];
  }
  return;
}
int dp[N], g[N], trans[N], as[N], nps[N], at[N], num;
inline void print(int now) {
  if (!now) return;
  print(trans[now]);
  int lst = trans[now] / 2;
  if (now / 2 > lst + 1) as[++num] = lst + 1, at[num] = now / 2;
  return;
}
signed main() {
  scanf("%s%s", t1 + 1, t2 + 1);
  int tlen = strlen(t1 + 1);
  for (register int i = 1; i <= tlen; ++i)
    s[i * 2 - 1] = t1[i], s[i << 1] = t2[i];
  n = tlen << 1;
  memset(dp, 0x3f, sizeof(dp));
  len[1] = -1;
  fail[0] = fail[1] = tot = 1;
  dp[0] = 0;
  for (register int i = 1; i <= n; ++i) {
    expand(i);
    for (register int k = lst; k; k = anc[k]) {
      int pos = i - len[anc[k]] - dlt[k];
      g[k] = dp[pos];
      nps[k] = pos;
      if (fail[k] ^ anc[k]) {
        if (g[fail[k]] < g[k]) g[k] = g[fail[k]], nps[k] = nps[fail[k]];
      }
      if (!(i & 1) && g[k] + 1 < dp[i]) dp[i] = g[k] + 1, trans[i] = nps[k];
    }
    if (!(i & 1) && dp[i - 2] < dp[i] && s[i] == s[i - 1])
      dp[i] = dp[i - 2], trans[i] = i - 2;
  }
  if (dp[n] > tlen) puts("-1"), exit(0);
  print(n);
  printf("%d\n", num);
  for (register int i = 1; i <= num; ++i) printf("%d %d\n", as[i], at[i]);
  return 0;
}
}  // namespace yspm
signed main() { return yspm::main(); }