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;
const int MAXN = 1000005;
template <typename T>
inline void read(T &AKNOI) {
  T x = 0, flag = 1;
  char ch = getchar();
  while (!isdigit(ch)) {
    if (ch == '-') flag = -1;
    ch = getchar();
  }
  while (isdigit(ch)) {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  AKNOI = flag * x;
}
int n;
char s[MAXN], t[MAXN];
void init() {
  scanf("%s", s + 1);
  scanf("%s", t + 1);
  n = strlen(s + 1);
  for (int i = n; i >= 1; --i) {
    s[i * 2 - 1] = s[i];
    s[i * 2] = t[i];
  }
  n <<= 1;
}
struct PAM {
  int tot, last, ch[MAXN][26], fa[MAXN], maxl[MAXN];
  int dif[MAXN], ff[MAXN], g[MAXN], dp[MAXN], ds[MAXN];
  void extend(int x, int i) {
    int p = last;
    while (s[i - maxl[p] - 1] != s[i]) {
      p = fa[p];
    }
    if (!ch[p][x]) {
      int np = ++tot, q = fa[p];
      maxl[np] = maxl[p] + 2;
      while (s[i - maxl[q] - 1] != s[i]) {
        q = fa[q];
      }
      fa[np] = ch[q][x];
      ch[p][x] = np;
      dif[np] = maxl[np] - maxl[fa[np]];
      if (dif[np] == dif[fa[np]]) {
        ff[np] = ff[fa[np]];
      } else {
        ff[np] = fa[np];
      }
    }
    last = ch[p][x];
  }
  void solve() {
    fa[0] = fa[1] = tot = 1;
    maxl[1] = -1;
    memset(dp, 0x3f, sizeof(dp));
    dp[0] = 0;
    for (int i = 1; i <= n; ++i) {
      extend(s[i] - 'a', i);
      for (int j = last; j; j = ff[j]) {
        g[j] = i - maxl[ff[j]] - dif[j];
        if (dif[j] == dif[fa[j]] && dp[g[j]] > dp[g[fa[j]]]) {
          g[j] = g[fa[j]];
        }
        if ((i % 2 == 0) && dp[i] > dp[g[j]] + 1) {
          dp[i] = dp[g[j]] + 1;
          ds[i] = g[j];
        }
      }
      if ((i % 2 == 0) && s[i] == s[i - 1]) {
        if (dp[i] > dp[i - 2]) {
          dp[i] = dp[i - 2];
          ds[i] = i - 2;
        }
      }
    }
    if (dp[n] > n) {
      printf("-1");
      return;
    }
    printf("%d\n", dp[n]);
    for (int i = n; i; i = ds[i]) {
      if (ds[i] < i - 2) {
        printf("%d %d\n", ds[i] / 2 + 1, i / 2);
      }
    }
  }
} pam;
int main() {
  init();
  pam.solve();
  return 0;
}