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>
bool GetMin(T &a, T b) {
  return ((a <= b) ? false : (a = b, true));
}
template <typename T>
bool GetMax(T &a, T b) {
  return ((a >= b) ? false : (a = b, true));
}
const int N = 1e6 + 10;
const int ALPHA = 26;
const int INF = 0x3f3f3f3f;
char t0[N], t1[N];
int s[N], n;
int ch[N][ALPHA], fa[N], sf[N], last, tot, len[N], diff[N], dp[N], rec[N],
    sdp[N], srec[N];
void Init() {
  s[0] = -233;
  last = len[0] = 0;
  len[1] = -1;
  fa[0] = tot = 1;
  fa[1] = 0;
}
void Append(int k) {
  int p = last, c = s[k];
  for (; c != s[k - len[p] - 1]; p = fa[p])
    ;
  if (!ch[p][c]) {
    last = ++tot;
    len[last] = len[p] + 2;
    int t = fa[p];
    for (; c != s[k - len[t] - 1]; t = fa[t])
      ;
    fa[last] = t = ch[t][c];
    ch[p][c] = last;
    if ((diff[last] = len[last] - len[t]) == diff[t])
      sf[last] = sf[t];
    else
      sf[last] = t;
  } else
    last = ch[p][c];
}
int main() {
  scanf("%s%s", t0 + 1, t1 + 1);
  n = strlen(t0 + 1);
  for (int i = 1; i <= n; ++i) {
    s[i * 2 - 1] = t0[i] - 'a';
    s[i * 2] = t1[i] - 'a';
  }
  n <<= 1;
  Init();
  for (int i = 1; i <= n; ++i) {
    Append(i);
    if (!(i & 1) && s[i - 1] == s[i]) {
      dp[i] = dp[i - 2];
      rec[i] = i - 2;
    } else
      dp[i] = INF;
    for (int v = last; len[v] > 0; v = sf[v]) {
      sdp[v] = dp[srec[v] = i - (len[sf[v]] + diff[v])];
      if (diff[v] == diff[fa[v]]) {
        if (GetMin(sdp[v], sdp[fa[v]])) srec[v] = srec[fa[v]];
      }
      if (!(i & 1) && GetMin(dp[i], sdp[v] + 1)) rec[i] = srec[v];
    }
  }
  if (dp[n] < INF) {
    printf("%d\n", dp[n]);
    for (int i = n; i; i = rec[i])
      if (rec[i] / 2 + 1 < i / 2) printf("%d %d\n", rec[i] / 2 + 1, i / 2);
  } else
    puts("-1");
  return 0;
}