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 inf = 1e9 + 9;
char str[2][510000], text[1010000];
int n, ans[1010000], num_node, fail[1010000], nxt[1010000], len[1010000],
    to[1010000][26], path[1010000], pa[1010000];
int dl[1010000], last, save[1010000], ie[1010000];
void init() {
  num_node = 2;
  fail[0] = 1;
  len[1] = -1;
  len[0] = 0;
  nxt[0] = 1;
  last = 0;
}
int get_fail(int id, int pos) {
  while (pos - len[id] - 1 < 1 || text[pos - len[id] - 1] != text[pos])
    id = fail[id];
  return id;
}
void add_letter(int pos) {
  int cur = get_fail(last, pos);
  if (!to[cur][text[pos] - 'a']) {
    len[num_node] = len[cur] + 2;
    fail[num_node] = to[get_fail(fail[cur], pos)][text[pos] - 'a'];
    dl[num_node] = len[num_node] - len[fail[num_node]];
    if (dl[num_node] == dl[fail[num_node]])
      nxt[num_node] = nxt[fail[num_node]];
    else
      nxt[num_node] = fail[num_node];
    to[cur][text[pos] - 'a'] = num_node++;
  }
  last = to[cur][text[pos] - 'a'];
}
int main() {
  scanf("%s%s", str[0], str[1]);
  n = strlen(str[0]);
  int i, j, s, p, q;
  for (i = 0; i < n; i++) {
    text[2 * i] = str[0][i];
    text[2 * i + 1] = str[1][i];
  }
  n *= 2;
  for (i = n - 1; i >= 0; i--) text[i + 1] = text[i];
  init();
  for (i = 1; i <= n; i++) {
    add_letter(i);
    ans[i] = inf;
    for (j = last; len[j] > 0; j = nxt[j]) {
      save[j] = ans[i - len[nxt[j]] - dl[j]];
      path[j] = i - len[nxt[j]] - dl[j];
      if (dl[j] == dl[fail[j]]) {
        if (save[j] > save[fail[j]]) {
          save[j] = save[fail[j]];
          path[j] = path[fail[j]];
        }
      }
      if (!(i & 1)) {
        if (ans[i] > save[j] + 1) {
          ans[i] = save[j] + 1;
          pa[i] = path[j];
        }
      }
    }
    if (!(i & 1) && text[i] == text[i - 1]) {
      if (ans[i] > ans[i - 2]) {
        ans[i] = ans[i - 2];
        pa[i] = i - 2;
      }
    }
  }
  if (ans[n] == inf)
    puts("-1");
  else {
    printf("%d\n", ans[n]);
    int id = n;
    while (id > 0) {
      if (pa[id] + 2 != id) printf("%d %d\n", pa[id] / 2 + 1, id / 2);
      id = pa[id];
    }
  }
  return 0;
}