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 = 1e6 + 2;
const int S = 26;
const int INF = 1e7;
char a[N + 3];
char b[N + 3];
char s[N + 3];
int dp[N + 3];
int g[N + 3];
int mnid[N + 3];
int len[N + 3];
int son[N + 3][S + 3];
int fail[N + 3];
int bd[N + 3];
int n, siz, lstpos;
void initPAM() {
  siz = lstpos = 1;
  fail[0] = fail[1] = 1;
  len[0] = 0;
  len[1] = -1;
}
void insertchar(int id) {
  int p = lstpos;
  while (s[id] != s[id - len[p] - 1]) {
    p = fail[p];
  }
  if (!son[p][s[id]]) {
    siz++;
    int u = siz, v = fail[p];
    while (s[id] != s[id - len[v] - 1]) {
      v = fail[v];
    }
    fail[u] = son[v][s[id]];
    son[p][s[id]] = u;
    len[u] = len[p] + 2;
    bd[u] = (len[u] - len[fail[u]] == len[fail[u]] - len[fail[fail[u]]])
                ? bd[fail[u]]
                : fail[u];
  }
  lstpos = son[p][s[id]];
}
int main() {
  initPAM();
  scanf("%s", a + 1);
  n = strlen(a + 1);
  scanf("%s", b + 1);
  for (int i = 1; i <= n; i++) {
    a[i] -= 96;
    b[i] -= 96;
  }
  for (int i = 1; i <= n; i++) {
    s[2 * i - 1] = a[i];
    s[2 * i] = b[i];
  }
  for (int i = 1; i <= n + n; i++) {
    g[i] = i;
    dp[i] = INF;
  }
  for (int i = 1; i <= n + n; i++) {
    insertchar(i);
    for (int j = lstpos; j; j = bd[j]) {
      mnid[j] = i - len[bd[j]] - (len[j] - len[fail[j]]);
      if (bd[j] != fail[j] && dp[mnid[fail[j]]] < dp[mnid[j]]) {
        mnid[j] = mnid[fail[j]];
      }
      if ((!(i & 1)) && dp[mnid[j]] + 1 < dp[i]) {
        g[i] = mnid[j];
        dp[i] = dp[mnid[j]] + 1;
      }
    }
    if ((!(i & 1)) && s[i] == s[i - 1]) {
      if (dp[i - 2] < dp[i]) {
        g[i] = i - 2;
        dp[i] = dp[i - 2];
      }
    }
  }
  if (dp[n + n] == INF)
    puts("-1");
  else {
    printf("%d\n", dp[n + n]);
    int j = n + n;
    while (j > 0) {
      if (j - g[j] > 2) {
        printf("%d %d\n", (g[j] >> 1) + 1, (j >> 1));
      }
      j = g[j];
    }
  }
  return 0;
}