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 + 50, inf = 0x3f3f3f3f;
int T, n, tp[2];
char s[N], a[N], b[N];
struct node {
  int s, d, sz;
  int mx() { return s + d * (sz - 1); }
} st[2][N];
struct Mes {
  int val, fr;
  bool operator<(const Mes &b) const {
    return val != b.val ? val < b.val : fr < b.fr;
  }
  Mes ad() { return (Mes){val + 1, fr}; }
} f[N], g[N];
void cmin(Mes &x, Mes y) { y < x ? x = y, 0 : 0; }
void ins1(node *st, int &tp, int x) {
  if (!tp)
    st[++tp] = (node){x, inf, 1};
  else {
    int d = x - st[tp].mx();
    if (d == st[tp].d)
      st[tp].sz++;
    else
      st[++tp] = (node){x, d, 1};
  }
}
void ins2(node *st, int &tp, node x) {
  if (tp && st[tp].d == x.d)
    st[tp].sz += x.sz;
  else
    st[++tp] = x;
}
void trans(node *s1, node *s2, int &t1, int &t2, char c) {
  t2 = 0;
  for (int i = 1; i <= t1; i++)
    if (c == s[s1[i].s - 1]) {
      ins1(s2, t2, s1[i].s - 1);
      if (s1[i].sz != 1)
        ins2(s2, t2, (node){s1[i].s + s1[i].d - 1, s1[i].d, s1[i].sz - 1});
    }
}
int main() {
  scanf("%s%s", a + 1, b + 1);
  n = strlen(a + 1);
  for (int i = 1; i <= n; i++) s[i * 2 - 1] = a[i], s[i * 2] = b[i];
  n *= 2;
  for (int i = 1; i <= n; i++) f[i] = g[i] = (Mes){inf, 0};
  for (int i = 1, p = 1, q = 0; i <= n; i++, p ^= 1, q ^= 1) {
    trans(st[p], st[q], tp[p], tp[q], s[i]);
    if (i > 1 && s[i] == s[i - 1])
      ins1(st[q], tp[q], i - 1), f[i] = (Mes){f[i - 2].val, i - 2};
    ins1(st[q], tp[q], i);
    node *a = st[q];
    if (tp[q] && !(i & 1) && (a[1].s & 1))
      cmin(f[i], (Mes){f[a[1].s - 1].val + 1, a[1].s - 1});
    for (int j = 2; j <= tp[q]; j++) {
      int d = a[j].d;
      if (a[j].mx() & 1)
        g[i - d] = (Mes){f[a[j].mx() - 1].val + 1, a[j].mx() - 1};
      else
        g[i - d] = (Mes){inf, 0};
      if (a[j].sz ^ 1) cmin(g[i - d], g[i - 2 * d]);
      if (!(i & 1)) cmin(f[i], g[i - d]);
    }
  }
  if (f[n].val == inf) puts("-1"), exit(0);
  printf("%d\n", f[n].val);
  int x = n;
  while (x) {
    if (f[x].fr != x - 2) printf("%d %d\n", f[x].fr / 2 + 1, x / 2);
    x = f[x].fr;
  }
  return 0;
}