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 = 1000005;
int n;
struct Node {
  int v, fr;
} dp[N], g[N];
inline bool operator<(const Node &a, const Node &b) {
  return a.v == b.v ? a.fr < b.fr : a.v < b.v;
}
struct Data {
  int s, d, sz;
  inline int v() { return s + d * (sz - 1); }
} se[2][505];
int tp[2];
int al[N], ar[N], atp;
void ins1(Data *b, int &hd, int s) {
  if (!hd) {
    b[++hd] = {s, INT_MAX >> 1, 1};
  } else {
    int del = s - b[hd].v();
    if (del == b[hd].d)
      ++b[hd].sz;
    else
      b[++hd] = {s, del, 1};
  }
}
void ins2(Data *b, int &hd, const Data &p) {
  if (b[hd].d == p.d)
    b[hd].sz += p.sz;
  else
    b[++hd] = p;
}
char ss[N], ss1[N / 2], ss2[N / 2];
void trs(Data *a, int tp, Data *b, int &hd, char c) {
  hd = 0;
  for (int i = 1; i <= tp; i++)
    if (ss[a[i].s - 1] == c) {
      ins1(b, hd, a[i].s - 1);
      if (a[i].sz != 1) ins2(b, hd, {a[i].s + a[i].d - 1, a[i].d, a[i].sz - 1});
    }
}
int main() {
  ios::sync_with_stdio(false);
  cin >> (ss1 + 1) >> (ss2 + 1);
  n = strlen(ss1 + 1);
  for (int i = 1; i <= n; i++) ss[i << 1] = ss1[i];
  for (int i = 1; i <= n; i++) ss[i * 2 - 1] = ss2[i];
  n <<= 1;
  ss[0] = '#';
  for (int i = 1; i <= n; i++) g[i] = {INT_MAX >> 1, 0};
  for (int i = 1; i <= n; i++) dp[i] = {INT_MAX >> 1, 0};
  for (int i = 1, p = 1, q = 0; i <= n; i++, p ^= 1, q ^= 1) {
    trs(se[q], tp[q], se[p], tp[p], ss[i]);
    if (ss[i] == ss[i - 1]) ins1(se[p], tp[p], i - 1);
    if (i & 1) continue;
    if (ss[i] == ss[i - 1]) dp[i] = min(dp[i], {dp[i - 2].v, i - 2});
    Data *a = se[p];
    for (int j = 1; j <= tp[p]; j++) {
      Node ret = {INT_MAX >> 1, 0};
      int ed = a[j].v() - 1;
      if (a[j].sz == 1)
        ret = min(Node{dp[ed].v + 1, ed}, ret);
      else {
        ret = min(Node{dp[ed].v + 1, ed}, g[a[j].s - a[j].d]);
      }
      if (a[j].s - a[j].d >= 0) g[a[j].s - a[j].d] = ret;
      dp[i] = min(dp[i], ret);
    }
  }
  if (dp[n].v == INT_MAX >> 1) {
    cout << -1 << endl;
    return 0;
  }
  for (int p = n; p > 0; p = dp[p].fr)
    if (dp[p].fr < p - 2) {
      al[++atp] = dp[p].fr + 1;
      ar[atp] = p;
    }
  cout << atp << endl;
  for (int i = 1; i <= atp; i++)
    cout << (al[i] + 1) / 2 << ' ' << (ar[i] + 1) / 2 << endl;
  return 0;
}