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;
const int inf = ~0u >> 2;
char ss[N], tt[N], s[N];
namespace PAM {
struct node {
  int tr[26];
  int fail, len, slink;
} G[N];
int f[N], g[N], d[N];
int sol[N];
int last, tot;
void init() {
  last = 0, tot = 1;
  G[0].len = 0, G[1].len = -1;
  G[0].fail = 1, G[1].fail = 0;
  G[0].slink = 1, G[1].slink = 0;
}
void insert(char c, int x) {
  int p = last;
  while (s[x] != s[x - G[p].len - 1]) p = G[p].fail;
  int b = c - 'a';
  if (!G[p].tr[b]) {
    int q = ++tot;
    G[q].len = G[p].len + 2;
    int _p = G[p].fail;
    while (s[x] != s[x - G[_p].len - 1]) _p = G[_p].fail;
    G[q].fail = G[_p].tr[b];
    d[q] = G[q].len - G[G[q].fail].len;
    if (d[q] == d[G[q].fail])
      G[q].slink = G[G[q].fail].slink;
    else
      G[q].slink = G[q].fail;
    G[p].tr[b] = q;
  }
  last = G[p].tr[b];
  if (!(x & 1) && s[x] == s[x - 1] && f[x] > f[x - 2])
    f[x] = f[x - 2], sol[x] = x - 2;
  int _p = last;
  while (_p >= 2) {
    g[_p] = x - G[G[_p].slink].len - d[_p];
    if (G[_p].slink != G[_p].fail && f[g[_p]] > f[g[G[_p].fail]])
      g[_p] = g[G[_p].fail];
    if (!(x & 1) && f[x] > f[g[_p]] + 1) f[x] = f[g[_p]] + 1, sol[x] = g[_p];
    _p = G[_p].slink;
  }
}
}  // namespace PAM
using namespace PAM;
int main() {
  memset(f, 127, sizeof(f));
  f[0] = 0;
  init();
  scanf("%s", ss + 1);
  scanf("%s", tt + 1);
  int len = strlen(ss + 1);
  int l1 = 1, l2 = 1;
  for (int i = 1; i <= len * 2; i++)
    s[i] = i & 1 ? ss[l1++] : tt[l2++], insert(s[i], i);
  if (f[len << 1] > inf) return puts("-1"), 0;
  cout << f[len * 2] << endl;
  for (int i = len * 2; i; i = sol[i])
    if (i - sol[i] > 2) printf("%d %d\n", sol[i] / 2 + 1, i >> 1);
  return 0;
}