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 = 5e5 + 10;
char s[N * 2], a[N], b[N];
vector<int> P, P1;
int n, m;
struct Tri {
  int st, delta, len;
  int val;
  Tri() {}
  Tri(int st1, int delta1, int len1) {
    st = st1;
    delta = delta1;
    len = len1;
  }
  friend bool operator==(Tri x, Tri y) { return x.delta == y.delta; }
};
struct Data {
  int v, pos;
  Data() {}
  Data(int v1, int pos1) {
    v = v1;
    pos = pos1;
  }
  friend bool operator<(Data x, Data y) { return x.v < y.v; }
} pl[N * 2], gpl[N * 2];
vector<Tri> G, G1, G2;
void dp_nlogn(int n) {
  int r;
  Tri x;
  Data tmp;
  for (int i = 1; i <= n; ++i) pl[i] = gpl[i] = Data(n + 1, -1);
  pl[0] = Data(0, 0);
  G.clear();
  for (int j = 1; j <= n; ++j) {
    G1.clear();
    for (int i = 0; i < G.size(); ++i) {
      x = G[i];
      if (x.st > 1 && s[x.st - 1] == s[j])
        G1.push_back(Tri(x.st - 1, x.delta, x.len));
    }
    G2.clear();
    r = -j;
    for (int i = 0; i < G1.size(); ++i) {
      x = G1[i];
      if (x.st - r != x.delta) {
        G2.push_back(Tri(x.st, x.st - r, 1));
        if (x.len > 1) G2.push_back(Tri(x.st + x.delta, x.delta, x.len - 1));
      } else
        G2.push_back(x);
      r = x.st + (x.len - 1) * x.delta;
    }
    if (j > 1 && s[j - 1] == s[j]) {
      G2.push_back(Tri(j - 1, j - 1 - r, 1));
      r = j - 1;
    }
    G2.push_back(Tri(j, j - r, 1));
    G.clear();
    x = G2[0];
    for (int i = 1; i < G2.size(); ++i) {
      if (G2[i] == x)
        x.len += G2[i].len;
      else {
        G.push_back(x);
        x = G2[i];
      }
    }
    G.push_back(x);
    if (j % 2 == 0) {
      if (s[j] == s[j - 1]) pl[j] = min(pl[j], Data(pl[j - 2].v, j - 2));
    }
    for (int i = 0; i < G.size(); ++i) {
      x = G[i];
      r = x.st + (x.len - 1) * x.delta;
      if (r & 1)
        tmp = Data(pl[r - 1].v + 1, r - 1);
      else
        tmp = Data(n + 1, -1);
      if (x.delta <= x.st) {
        if (x.len > 1) tmp = min(tmp, gpl[x.st - x.delta]);
        gpl[x.st - x.delta] = tmp;
      }
      if (j % 2 == 0) pl[j] = min(pl[j], tmp);
    }
  }
}
int main() {
  scanf("%s", a + 1);
  scanf("%s", b + 1);
  n = strlen(a + 1);
  for (int i = 1, pos = 1; i <= n; ++i, pos += 2) s[pos] = a[i];
  n = strlen(b + 1);
  for (int i = 1, pos = 2; i <= n; ++i, pos += 2) s[pos] = b[i];
  n = strlen(s + 1);
  dp_nlogn(n);
  if (pl[n].v > n)
    printf("-1\n");
  else {
    printf("%d\n", pl[n].v);
    for (int i = n; i >= 1; i = pl[i].pos)
      if (i - pl[i].pos > 2) {
        printf("%d %d\n", pl[i].pos / 2 + 1, i / 2);
      }
  }
}