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 N = 1e6 + 50;
const int INF = 1e9 + 7;
char str[N], S[N];
int n, f[N], g[N], mnf[N], mng[N], anc[N];
namespace PAM {
int nd, las, nl, lk[N], ch[N][26], len[N];
void init() {
  nd = 1;
  las = 1;
  lk[0] = 1;
  len[1] = -1;
}
int jmp(int x) {
  while (S[nl - len[x] - 1] != S[nl]) x = lk[x];
  return x;
}
void extend(int c) {
  ++nl;
  int p = jmp(las);
  if (!ch[p][c]) {
    int now = ++nd;
    len[now] = len[p] + 2;
    lk[now] = ch[jmp(lk[p])][c];
    ch[p][c] = now;
    if (lk[now] > 1 &&
        (len[now] - len[lk[now]] == len[lk[now]] - len[lk[lk[now]]]))
      anc[now] = anc[lk[now]];
    else
      anc[now] = now;
  }
  las = ch[p][c];
}
}  // namespace PAM
using PAM::len;
using PAM::lk;
int main() {
  scanf("%s", str + 1);
  n = strlen(str + 1);
  for (int i = 1; i <= n; i++) S[(i << 1) - 1] = str[i];
  scanf("%s", str + 1);
  for (int i = 1; i <= n; i++) S[i << 1] = str[i];
  n <<= 1;
  memset(f, 0x3f, sizeof(f));
  f[0] = 0;
  mnf[0] = mnf[1] = INF;
  PAM::init();
  for (int i = 1; i <= n; i++) {
    PAM::extend(S[i] - 'a');
    for (int u = PAM::las; u > 1; u = lk[anc[u]]) {
      mnf[u] = f[i - len[anc[u]]];
      mng[u] = i - len[anc[u]];
      if (anc[u] != u && mnf[lk[u]] < mnf[u])
        mnf[u] = mnf[lk[u]], mng[u] = mng[lk[u]];
      if ((i & 1 ^ 1) && f[i] > mnf[u] + 1) f[i] = mnf[u] + 1, g[i] = mng[u];
    }
    if ((i & 1 ^ 1) && S[i - 1] == S[i] && f[i - 2] < f[i])
      f[i] = f[i - 2], g[i] = i - 2;
  }
  if (f[n] > INF) {
    puts("-1");
    return 0;
  }
  cout << f[n] << '\n';
  for (int u = n; u; u = g[u])
    if (f[g[u]] < f[u]) cout << (g[u] >> 1) + 1 << " " << (u >> 1) << '\n';
}