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 = 1000005;
char s1[maxn], s2[maxn], s[maxn];
int dp[maxn], n, adj[maxn][26];
int qlink[maxn], dif[maxn], par[maxn], len[maxn], cur, tot, fr[maxn], ans[maxn];
int extend(int pos) {
  int p = cur, ch = s[pos] - 'a';
  while (s[pos] != s[pos - len[p] - 1]) p = par[p];
  if (!adj[p][ch]) {
    int q = ++tot;
    len[q] = len[p] + 2;
    int t = par[p];
    while (s[pos] != s[pos - len[t] - 1]) t = par[t];
    t = adj[t][ch];
    par[q] = t;
    dif[q] = len[q] - len[t];
    qlink[q] = dif[q] == dif[t] ? qlink[t] : t;
    adj[p][ch] = q;
  }
  return adj[p][ch];
}
int main() {
  scanf("%s %s", s1 + 1, s2 + 1);
  n = strlen(s1 + 1);
  for (int i = 1; i <= n; i++) s[i * 2 - 1] = s1[i], s[i << 1] = s2[i];
  cur = 0;
  tot = 1;
  par[0] = par[1] = 1;
  len[1] = -1;
  for (int i = 1; i <= n << 1; i++) {
    cur = extend(i);
    ans[i] = 1 << 30;
    for (int p = cur; p; p = qlink[p]) {
      dp[p] = i - len[qlink[p]] - dif[p];
      if (qlink[p] != par[p] && ans[dp[par[p]]] < ans[dp[p]])
        dp[p] = dp[par[p]];
      if (i % 2 == 0 && ans[dp[p]] + 1 < ans[i])
        ans[i] = ans[dp[p]] + 1, fr[i] = dp[p];
    }
    if (i % 2 == 0 && s[i] == s[i - 1] && ans[i - 2] < ans[i])
      ans[i] = ans[i - 2], fr[i] = i - 2;
  }
  if (ans[n << 1] > n)
    puts("-1");
  else {
    printf("%d\n", ans[n << 1]);
    for (int p = n << 1; p; p = fr[p])
      if (fr[p] != p - 2) printf("%d %d\n", fr[p] / 2 + 1, p / 2);
  }
  return 0;
}