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 = 1e6 + 5;
const int inf = 0x3f3f3f3f;
const int mod = 1e9 + 7;
char s[maxn], s1[maxn], s2[maxn];
int nxt[maxn][26], fail[maxn], len[maxn], dt[maxn], st[maxn];
int g[maxn], f[maxn], pf[maxn];
int n, cnt, cur, last;
int add(int l) {
  ++cnt;
  memset(nxt[cnt], 0, sizeof nxt[cnt]);
  len[cnt] = l, fail[cnt] = 0;
  return cnt;
}
void init() {
  cnt = -1, add(0), add(-1);
  s[0] = '@', cur = last = fail[0] = 1;
}
int getf(int x) {
  while (s[cur] != s[cur - len[x] - 1]) x = fail[x];
  return x;
}
void insert(char ch) {
  s[cur] = ch;
  int t = ch - 'a', p = getf(last);
  if (!nxt[p][t]) {
    int q = add(len[p] + 2);
    fail[q] = nxt[getf(fail[p])][t];
    dt[q] = len[q] - len[fail[q]];
    st[q] = dt[q] == dt[fail[q]] ? st[fail[q]] : fail[q];
    nxt[p][t] = q;
  }
  last = nxt[p][t], ++cur;
}
void solve() {
  init();
  f[0] = 0;
  for (int i = 1; i <= n; ++i) {
    insert(s[i]), f[i] = inf;
    for (int j = last; j; j = st[j]) {
      g[j] = i - len[st[j]] - dt[j];
      if (st[j] != fail[j] && f[g[fail[j]]] < f[g[j]]) g[j] = g[fail[j]];
      if ((~i & 1) && f[i] > f[g[j]] + 1) f[i] = f[g[j]] + 1, pf[i] = g[j];
    }
    if ((~i & 1) && s[i] == s[i - 1] && f[i] > f[i - 2])
      f[i] = f[i - 2], pf[i] = i - 2;
  }
  if (f[n] == inf) {
    cout << "-1\n";
    return;
  }
  cout << f[n] << "\n";
  for (int i = n; i >= 1; i = pf[i]) {
    if (i - pf[i] != 2) cout << pf[i] / 2 + 1 << " " << i / 2 << "\n";
  }
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cin >> s1 + 1 >> s2 + 1;
  n = strlen(s1 + 1);
  for (int i = 1; i <= n; ++i) {
    s[i * 2 - 1] = s1[i];
    s[i * 2] = s2[i];
  }
  n <<= 1;
  solve();
  return 0;
}