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 MOD = 998244353, inv2 = (MOD + 1) / 2;
double eps = 1e-6;
int INF = 1 << 29;
long long inf = 5e13;
int dx[4] = {-1, 1, 0, 0};
int dy[4] = {0, 0, -1, 1};
char a[1100010], b[1100010];
int s[1100010];
int n;
int q, p, id, num[1100010], F[1100010], f[1100010], _f[1100010], pre[1100010],
    len[1100010], sk[1100010], df[1100010], t[1100010][26];
struct pam {
  void add(int x, int n) {
    while (s[n - len[p] - 1] != s[n]) p = F[p];
    if (!t[p][x]) {
      int q = ++id, k = F[p];
      len[q] = len[p] + 2;
      while (s[n - len[k] - 1] != s[n]) k = F[k];
      F[q] = t[k][x];
      t[p][x] = q;
      df[q] = len[q] - len[F[q]];
      sk[q] = (df[q] == df[F[q]] ? sk[F[q]] : F[q]);
    }
    p = t[p][x];
  }
} pam;
int read() {
  int v = 0, f = 1;
  char c = getchar();
  while (c < 48 || 57 < c) {
    if (c == '-') f = -1;
    c = getchar();
  }
  while (48 <= c && c <= 57) v = (v << 3) + v + v + c - 48, c = getchar();
  return v * f;
}
int main() {
  scanf("%s", a + 1);
  int m = strlen(a + 1);
  scanf("%s", b + 1);
  int n = 0;
  for (int i = (int)1; i <= (int)m; i++) {
    s[++n] = a[i] - 'a';
    s[++n] = b[i] - 'a';
  }
  s[n + 1] = s[0] = 100;
  id = F[0] = 1;
  len[1] = -1;
  _f[0] = 1;
  for (int i = (int)1; i <= (int)n; i++) f[i] = 1e9;
  for (int i = (int)1; i <= (int)n; i++) {
    pam.add(s[i], i);
    for (int x = p; x; x = sk[x]) {
      _f[x] = i - len[sk[x]] - df[x];
      if (df[F[x]] == df[x] && f[_f[x]] > f[_f[F[x]]]) _f[x] = _f[F[x]];
      if (i % 2 == 0 && f[i] > f[_f[x]] + 1)
        f[i] = f[_f[x]] + 1, pre[i] = _f[x];
      if (i % 2 == 0 && s[i] == s[i - 1] && f[i - 2] < f[i]) {
        f[i] = f[i - 2];
        pre[i] = i - 2;
      }
    }
  }
  if (f[n] == 1e9) {
    printf("-1\n");
    return 0;
  }
  printf("%d\n", f[n]);
  int k = n;
  while (k) {
    int t = pre[k];
    if (t < k - 2) printf("%d %d\n", t / 2 + 1, k / 2);
    k = t;
  }
  return 0;
}