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 = 1000007;
const int inf = 0x3f3f3f3f;
int f[N], pre[N], pos[N];
namespace Pam {
int n, s[N], last, tot, anc[N], fail[N], ch[N][27], len[N], diff[N];
void build() {
  memset(f, 0x3f, sizeof(f));
  memset(pre, 0, sizeof(pre));
  memset(pos, 0, sizeof(pos));
  memset(anc, 0, sizeof(anc));
  memset(fail, 0, sizeof(fail));
  memset(ch, 0, sizeof(ch));
  memset(len, 0, sizeof(len));
  fail[0] = fail[1] = tot = 1;
  s[last = n = f[0] = 0] = len[1] = -1;
}
int get_fail(int p) {
  while (s[n - len[p] - 1] != s[n]) p = fail[p];
  return p;
}
void insert(int c) {
  s[++n] = c;
  int cur = get_fail(last);
  if (!ch[cur][c]) {
    int now = ++tot;
    len[now] = len[cur] + 2;
    fail[now] = ch[get_fail(fail[cur])][c];
    diff[now] = len[now] - len[fail[now]];
    anc[now] =
        fail[now] > 1 && diff[now] == diff[fail[now]] ? anc[fail[now]] : now;
    ch[cur][c] = now;
  }
  last = ch[cur][c];
}
void dp() {
  for (int u = last; u > 1; u = fail[anc[u]]) {
    pos[u] = n - len[anc[u]];
    if (anc[u] != u && f[pos[fail[u]]] < f[pos[u]]) pos[u] = pos[fail[u]];
    if (!(n & 1) && f[pos[u]] < f[n]) f[n] = f[pos[u]] + 1, pre[n] = pos[u];
  }
  if (!(n & 1) && s[n] == s[n - 1] && f[n - 2] < f[n])
    f[n] = f[n - 2], pre[n] = n - 2;
}
}  // namespace Pam
char s1[N], s2[N];
int n;
void work() {
  int i;
  scanf("%s%s", s1 + 1, s2 + 1);
  n = strlen(s1 + 1);
  Pam::build();
  for (i = 1; i <= n; i++) {
    Pam::insert(s1[i] - 'a');
    Pam::dp();
    Pam::insert(s2[i] - 'a');
    Pam::dp();
  }
  if (f[n * 2] == inf) {
    printf("%d\n", -1);
    return;
  }
  printf("%d\n", f[n * 2]);
  for (i = n * 2; i; i = pre[i])
    if (i - pre[i] > 2) printf("%d %d\n", pre[i] / 2 + 1, i / 2);
}
int main() {
  work();
  return 0;
}