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 <class T>
inline void init(T& x) {
  x = 0;
  char ch = getchar();
  bool t = 0;
  for (; ch > '9' || ch < '0'; ch = getchar())
    if (ch == '-') t = 1;
  for (; ch >= '0' && ch <= '9'; ch = getchar())
    x = (x << 1) + (x << 3) + (ch - 48);
  if (t) x = -x;
  return;
}
const int N = 5e5 + 10;
char S[2][N];
namespace PAM {
const int MAXN = N << 1, INF = 1e9;
int son[MAXN][26], len[MAXN], fa[MAXN], dif[MAXN], anc[MAXN];
int lst, now;
char MS[N << 1];
int LS = 0, cnt = 0, pos[MAXN];
inline void Clear() {
  while (~cnt) {
    len[cnt] = fa[cnt] = 0;
    memset(son[cnt], 0, sizeof(son[cnt]));
    pos[cnt] = -1;
    --cnt;
  }
  lst = now = LS = 0;
  fa[1] = -1, fa[0] = 1, len[1] = -1, len[0] = 0;
  cnt = 1;
}
int dp[N << 1], Pre[N << 1];
struct Ans {
  int l, r;
  Ans() { l = 0, r = 0; }
  Ans(int _l, int _r) { l = _l, r = _r; }
};
Ans ans[N];
int cur = 0;
inline bool check(int l, int r) {
  for (int i = l + 1; i <= r; ++i)
    if (S[0][i] != S[1][i]) return 1;
  return 0;
}
inline int Find(int u) {
  while (~u && MS[now] != MS[now - len[u] - 1]) u = fa[u];
  return u;
}
inline void Extend(int c) {
  int u = Find(lst);
  if (!son[u][c]) {
    son[u][c] = ++cnt, fa[cnt] = son[Find(fa[u])][c], len[cnt] = len[u] + 2;
    dif[cnt] = len[cnt] - len[fa[cnt]];
    if (dif[cnt] == dif[fa[cnt]])
      anc[cnt] = anc[fa[cnt]];
    else
      anc[cnt] = fa[cnt];
  }
  lst = son[u][c];
}
inline void work() {
  Clear();
  int l1 = strlen(S[0] + 1), l2 = strlen(S[1] + 1);
  int i, j;
  for (LS = 1, i = 0, j = 0; i < l1 || j < l2; ++LS) {
    if (LS & 1)
      MS[LS] = S[0][++i];
    else
      MS[LS] = S[1][++j];
  }
  --LS;
  pos[0] = 0;
  for (dp[0] = 0, now = 1; now <= LS; ++now) {
    dp[now] = INF;
    Extend(MS[now] - 'a');
    Pre[now] = 0;
    for (int u = lst; u > 1; u = anc[u]) {
      int j = now - len[anc[u]] - dif[u];
      pos[u] = j;
      if (fa[u] != anc[u] && dp[pos[u]] > dp[pos[fa[u]]]) pos[u] = pos[fa[u]];
      if (!((now)&1) && dp[now] > dp[pos[u]] + 1)
        dp[now] = dp[pos[u]] + 1, Pre[now] = pos[u];
    }
    if (!((now)&1) && MS[now] == MS[now - 1]) {
      if (dp[now - 2] < dp[now]) {
        dp[now] = dp[now - 2];
        Pre[now] = now - 2;
      }
    }
  }
  now = LS;
  cur = 0;
  if (dp[LS] == INF) {
    puts("-1");
    return;
  }
  while (now) {
    int nxt = Pre[now];
    if (check(nxt >> 1, now >> 1)) ans[++cur] = Ans((nxt >> 1) + 1, now >> 1);
    now = nxt;
  }
  printf("%d\n", cur);
  for (int i = 1; i <= cur; ++i) printf("%d %d\n", ans[i].l, ans[i].r);
}
}  // namespace PAM
int main() {
  scanf("%s", S[0] + 1);
  scanf("%s", S[1] + 1);
  PAM::work();
  return 0;
}