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 = 2000010;
int n, p, cnt, fail[N], nxt[N][26], len[N], diff[N], dfail[N];
char s[N], t[N], a[N];
void extend(int x) {
  int c = a[x] - 'a';
  while (a[x] != a[x - len[p] - 1]) p = fail[p];
  if (!nxt[p][c]) {
    int cur = ++cnt, k = fail[p];
    len[cur] = len[p] + 2;
    while (a[x] != a[x - len[k] - 1]) k = fail[k];
    fail[cur] = nxt[k][c];
    nxt[p][c] = cur;
    diff[cur] = len[cur] - len[fail[cur]];
    if (diff[cur] == diff[fail[cur]])
      dfail[cur] = dfail[fail[cur]];
    else
      dfail[cur] = fail[cur];
  }
  p = nxt[p][c];
}
int f[N >> 1], g[N >> 1], frm[N >> 1], pos[N >> 1];
inline bool check(int l, int r) {
  for (int i = l; i <= r; i += 2)
    if (a[i] != a[i + 1]) return true;
  return false;
}
vector<pair<int, int> > ans;
int main() {
  scanf("%s%s", s + 1, t + 1);
  int l = strlen(s + 1);
  for (int i = 1; i <= l; i++) a[++n] = s[i], a[++n] = t[i];
  fail[0] = fail[1] = 1;
  len[1] = -1;
  diff[0] = 1;
  g[0] = 1 << 30;
  p = 0;
  cnt = 1;
  for (int i = 1; i <= n; i++) {
    extend(i);
    f[i] = 1 << 30;
    if (a[i] == a[i - 1]) f[i] = f[i - 2], frm[i] = i - 2;
    for (int np = p; np; np = dfail[np]) {
      g[np] = f[i - len[dfail[np]] - diff[np]];
      pos[np] = i - len[dfail[np]] - diff[np];
      if (diff[np] == diff[fail[np]] && g[fail[np]] < g[np])
        g[np] = min(g[np], g[fail[np]]), pos[np] = pos[fail[np]];
      if (g[np] + 1 < f[i]) f[i] = g[np] + 1, frm[i] = pos[np];
    }
    if (i & 1) f[i] = 1 << 30;
  }
  if (f[n] == 1 << 30) return puts("-1"), 0;
  while (n) {
    if (check(frm[n] + 1, n))
      ans.push_back(pair<int, int>(frm[n] / 2 + 1, n / 2));
    n = frm[n];
  }
  printf("%d\n", (int)ans.size());
  for (int i = 0; i < ans.size(); i++)
    printf("%d %d\n", ans[i].first, ans[i].second);
  return 0;
}