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;
int mark[maxn], pre[maxn], g[maxn], f[maxn], top[maxn], d[maxn], len[maxn],
    fail[maxn], go[maxn][26], tot, lst;
char t[maxn], tt[maxn], s[maxn];
void build() {
  s[0] = -1;
  len[tot = 1] = -1;
  len[0] = 0;
  fail[1] = fail[0] = 1;
}
int ins(int n, int c) {
  int p = lst;
  while (s[n - len[p] - 1] != s[n]) p = fail[p];
  if (!go[p][c]) {
    int v = ++tot, k = fail[p];
    len[v] = len[p] + 2;
    while (s[n - len[k] - 1] != s[n]) k = fail[k];
    fail[v] = go[k][c];
    d[v] = len[v] - len[fail[v]];
    top[v] = d[v] == d[fail[v]] ? top[fail[v]] : fail[v];
    go[p][c] = v;
  }
  return lst = go[p][c];
}
int main() {
  memset(f, 0x3f, sizeof(f));
  f[0] = 0;
  scanf("%s%s", t + 1, tt + 1);
  int Len = strlen(t + 1);
  for (int i = 1; i <= Len; i++) s[2 * i - 1] = t[i], s[2 * i] = tt[i];
  Len <<= 1;
  build();
  for (int i = 1; i <= Len; i++) {
    ins(i, s[i] - 'a');
    for (int j = lst; j > 1; j = top[j]) {
      g[j] = i - len[top[j]] - d[j];
      if (d[j] == d[fail[j]]) {
        if (f[g[j]] > f[g[fail[j]]]) {
          g[j] = g[fail[j]];
        }
      }
      if (i % 2 == 0) {
        if (f[g[j]] + 1 < f[i]) {
          f[i] = f[g[j]] + 1;
          pre[i] = g[j];
          mark[i] = 1;
        }
      }
    }
    if (i % 2 == 0) {
      if (s[i] == s[i - 1] && f[i - 2] < f[i]) {
        f[i] = f[i - 2];
        pre[i] = i - 2;
        mark[i] = 0;
      }
    }
  }
  if (f[Len] >= 0x3f3f3f3f) {
    puts("-1");
    return 0;
  }
  printf("%d\n", f[Len]);
  for (int i = Len; i; i = pre[i]) {
    if (mark[i]) printf("%d %d\n", pre[i] / 2 + 1, i / 2);
  }
  return 0;
}