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>
const int N = 1e6 + 5, inf = 1e9;
char s[N], t[N], p[N];
int n, dp[N], g[N], f[N];
namespace pam {
int len[N], fail[N], ch[N][26], tot, lst, df[N], link[N];
void init() {
  tot = lst = 1;
  len[1] = -1, len[0] = 0, fail[0] = 1;
}
void insert(char cr, int ed) {
  int c = cr;
  int p = lst;
  while (s[ed] != s[ed - len[p] - 1]) p = fail[p];
  if (!ch[p][c]) {
    int np = ++tot;
    len[np] = len[p] + 2;
    int q;
    for (q = fail[p]; s[ed] != s[ed - len[q] - 1]; q = fail[q])
      ;
    fail[np] = ch[q][c];
    ch[p][c] = np;
    df[np] = len[np] - len[fail[np]];
    link[np] = (df[np] == df[fail[np]]) ? link[fail[np]] : fail[np];
  }
  lst = ch[p][c];
}
}  // namespace pam
int ans = 0;
int main() {
  pam::init();
  scanf("%s%s", p + 1, t + 1);
  n = strlen(p + 1);
  for (int i = 1; i <= n; ++i) s[i * 2 - 1] = p[i], s[i * 2] = t[i];
  for (int i = 1; i <= 2 * n; ++i) {
    dp[i] = inf;
    pam::insert(s[i] - 'a', i);
    for (int u = pam::lst; u; u = pam::link[u]) {
      f[u] = i - pam::df[u] - pam::len[pam::link[u]];
      if (pam::df[u] == pam::df[pam::fail[u]] && dp[f[u]] > dp[f[pam::fail[u]]])
        f[u] = f[pam::fail[u]];
      if (i % 2 == 0 && dp[i] > dp[f[u]] + 1) {
        g[i] = f[u], dp[i] = dp[f[u]] + 1;
      }
    }
    if (i % 2 == 0 && s[i] == s[i - 1] && dp[i] >= dp[i - 2]) {
      dp[i] = dp[i - 2], g[i] = i - 2;
    }
  }
  if (dp[2 * n] > n) return puts("-1"), 0;
  printf("%d\n", dp[2 * n]);
  for (int i = 2 * n; i; i = g[i])
    if (g[i] + 2 < i) printf("%d %d\n", (g[i] >> 1) + 1, i >> 1);
  return 0;
}