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 + 10;
int ch[N][26], f[N], g[N], lst, len[N], n, cnt = 1;
pair<int, int> r[N], dp[N];
char s[N], t[N];
int main() {
  scanf("%s%s", s + 1, t + 1);
  n = strlen(s + 1);
  s[0] = -1;
  len[0] = 0;
  len[1] = -1;
  f[0] = 1;
  for (int i = (n); i >= (1); --i) s[i * 2 - 1] = s[i], s[i * 2] = t[i];
  n *= 2;
  for (int i = (1); i <= (n); ++i) {
    int c = s[i] - 97;
    dp[i] = make_pair(1e9, 0);
    while (s[i - len[lst] - 1] != s[i]) lst = f[lst];
    if (!ch[lst][c]) {
      int q = ++cnt, p = f[lst];
      len[q] = len[lst] + 2;
      while (s[i - len[p] - 1] != s[i]) p = f[p];
      f[q] = ch[p][c];
      ch[lst][c] = q;
      g[q] = f[q] > 1 && len[q] + len[f[f[q]]] == 2 * len[f[q]] ? g[f[q]] : q;
    }
    lst = ch[lst][c];
    for (int x = lst; x > 1; x = f[g[x]]) {
      r[x] = make_pair(dp[i - len[g[x]]].first + 1, i - len[g[x]]);
      if (g[x] != x) r[x] = min(r[x], r[f[x]]);
      if (i % 2 == 0) dp[i] = min(dp[i], r[x]);
    }
    if (i % 2 == 0 && s[i] == s[i - 1])
      dp[i] = min(dp[i], make_pair(dp[i - 2].first, i - 2));
  }
  if (dp[n].first >= 1e9) return puts("-1"), 0;
  printf("%d\n", dp[n].first);
  for (int i = n; i; i = dp[i].second)
    if (i - dp[i].second > 2) printf("%d %d\n", dp[i].second / 2 + 1, i / 2);
  return 0;
}