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;
int n, cnt, fail[1000050], ch[1000050][26], len[1000050], diff[1000050],
    top[1000050], lst;
int f[1000050], frm[1000050], g[1000050], pos[1000050];
char s[1000050], t[1000050], a[1000050];
vector<pair<int, int> > ans;
void insert(int x) {
  int c = a[x] - 'a', p = lst;
  for (; a[x] != a[x - len[p] - 1]; p = fail[p])
    ;
  if (!ch[p][c]) {
    int np = ++cnt, q = fail[p];
    len[np] = len[p] + 2;
    for (; a[x] != a[x - len[q] - 1]; q = fail[q])
      ;
    fail[np] = ch[q][c];
    ch[p][c] = np;
    diff[np] = len[np] - len[fail[np]];
    top[np] = diff[np] == diff[fail[np]] ? top[fail[np]] : fail[np];
  }
  lst = ch[p][c];
}
bool check(int l, int r) {
  int i;
  for (i = l; i <= r; i += 2)
    if (a[i] != a[i + 1]) return 1;
  return 0;
}
int main() {
  scanf("%s%s", s + 1, t + 1);
  int l = strlen(s + 1), i;
  for (i = 1; i <= l; i++) a[++n] = s[i], a[++n] = t[i];
  fail[0] = fail[1] = 1;
  len[1] = -1;
  cnt = 1;
  diff[0] = 1;
  lst = 0;
  g[0] = 1 << 30;
  for (i = 1; i <= n; i++) {
    insert(i);
    f[i] = 1 << 30;
    if (a[i] == a[i - 1]) f[i] = f[i - 2], frm[i] = i - 2;
    int p = lst;
    for (; p; p = top[p]) {
      g[p] = f[i - len[top[p]] - diff[p]];
      pos[p] = i - len[top[p]] - diff[p];
      if (diff[p] == diff[fail[p]] && g[fail[p]] < g[p]) {
        g[p] = g[fail[p]];
        pos[p] = pos[fail[p]];
      }
      if (g[p] + 1 < f[i]) {
        f[i] = g[p] + 1;
        frm[i] = pos[p];
      }
    }
    if (i & 1) f[i] = 1 << 30;
  }
  if (f[n] == 1 << 30) {
    puts("-1");
    return 0;
  }
  while (n) {
    if (check(frm[n] + 1, n))
      ans.push_back(pair<int, int>(frm[n] / 2 + 1, n / 2));
    n = frm[n];
  }
  int lim = ans.size();
  printf("%d\n", lim);
  for (i = 0; i < lim; i++) printf("%d %d\n", ans[i].first, ans[i].second);
  return 0;
}