#include <bits/stdc++.h>
template <class T>
inline void putint(T x) {
  static char buf[15], *tail = buf;
  if (!x)
    putchar('0');
  else {
    for (; x; x /= 10) *++tail = x % 10 + '0';
    for (; tail != buf; --tail) putchar(*tail);
  }
}
template <class T>
inline void tense(T &x, const T &y) {
  if (y < x) x = y;
}
const int base = 26;
const int MaxN = 1e6 + 5;
const int INF = 0x3f3f3f3f;
struct node {
  int val, frm;
  node() {}
  node(int a, int b) : val(a), frm(b) {}
  inline bool operator<(const node &rhs) const { return val < rhs.val; }
  inline node operator+(const node &rhs) const {
    return node(val + rhs.val, rhs.frm);
  }
} f[MaxN], g[MaxN];
int n, m;
char s[MaxN], t1[MaxN], t2[MaxN];
namespace PAM {
int lst, cur_n, nT = 1;
int fir[MaxN], del[MaxN];
int trans[MaxN][base], len[MaxN], par[MaxN];
inline void init() {
  len[1] = -1;
  par[0] = par[1] = 1;
}
inline int find(int x) {
  while (s[cur_n] != s[cur_n - len[x] - 1]) x = par[x];
  return x;
}
inline void extend(int ch) {
  ++cur_n, ch -= 'a';
  int cur = find(lst);
  if (!trans[cur][ch]) {
    int x = ++nT;
    par[x] = trans[find(par[cur])][ch];
    len[trans[cur][ch] = x] = len[cur] + 2;
    del[x] = len[x] - len[par[x]];
    if (del[x] == del[par[x]])
      fir[x] = fir[par[x]];
    else
      fir[x] = x;
    g[x] = node(INF, 0);
  }
  lst = trans[cur][ch];
}
}  // namespace PAM
int main() {
  scanf("%s%s", t1 + 1, t2 + 1);
  m = strlen(t1 + 1);
  for (int i = 1; i <= m; ++i) {
    s[++n] = t1[i];
    s[++n] = t2[i];
  }
  using namespace PAM;
  init();
  for (int i = 1; i <= n; ++i) {
    extend(s[i]);
    f[i] = node(INF, 0);
    for (int x = lst; x; x = par[fir[x]]) {
      g[x] = f[i - len[fir[x]]] + node(1, i - len[fir[x]]);
      if (x != fir[x]) tense(g[x], g[par[x]]);
      if (~i & 1) tense(f[i], g[x]);
    }
    if ((~i & 1) && s[i] == s[i - 1]) tense(f[i], f[i - 2] + node(0, i - 2));
  }
  if (f[n].val >= INF) {
    puts("-1");
    return 0;
  }
  std::cout << f[n].val << '\n';
  for (int cur = n; cur; cur = f[cur].frm) {
    if (f[cur].frm + 2 < cur || s[cur] != s[cur - 1]) {
      putint((f[cur].frm + 2) >> 1), putchar(' ');
      putint(cur >> 1), putchar('\n');
    }
  }
  return 0;
}

### Prompt

Please formulate a CPP solution to the following 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

### Response

```cpp
#include <bits/stdc++.h>
template <class T>
inline void putint(T x) {
  static char buf[15], *tail = buf;
  if (!x)
    putchar('0');
  else {
    for (; x; x /= 10) *++tail = x % 10 + '0';
    for (; tail != buf; --tail) putchar(*tail);
  }
}
template <class T>
inline void tense(T &x, const T &y) {
  if (y < x) x = y;
}
const int base = 26;
const int MaxN = 1e6 + 5;
const int INF = 0x3f3f3f3f;
struct node {
  int val, frm;
  node() {}
  node(int a, int b) : val(a), frm(b) {}
  inline bool operator<(const node &rhs) const { return val < rhs.val; }
  inline node operator+(const node &rhs) const {
    return node(val + rhs.val, rhs.frm);
  }
} f[MaxN], g[MaxN];
int n, m;
char s[MaxN], t1[MaxN], t2[MaxN];
namespace PAM {
int lst, cur_n, nT = 1;
int fir[MaxN], del[MaxN];
int trans[MaxN][base], len[MaxN], par[MaxN];
inline void init() {
  len[1] = -1;
  par[0] = par[1] = 1;
}
inline int find(int x) {
  while (s[cur_n] != s[cur_n - len[x] - 1]) x = par[x];
  return x;
}
inline void extend(int ch) {
  ++cur_n, ch -= 'a';
  int cur = find(lst);
  if (!trans[cur][ch]) {
    int x = ++nT;
    par[x] = trans[find(par[cur])][ch];
    len[trans[cur][ch] = x] = len[cur] + 2;
    del[x] = len[x] - len[par[x]];
    if (del[x] == del[par[x]])
      fir[x] = fir[par[x]];
    else
      fir[x] = x;
    g[x] = node(INF, 0);
  }
  lst = trans[cur][ch];
}
}  // namespace PAM
int main() {
  scanf("%s%s", t1 + 1, t2 + 1);
  m = strlen(t1 + 1);
  for (int i = 1; i <= m; ++i) {
    s[++n] = t1[i];
    s[++n] = t2[i];
  }
  using namespace PAM;
  init();
  for (int i = 1; i <= n; ++i) {
    extend(s[i]);
    f[i] = node(INF, 0);
    for (int x = lst; x; x = par[fir[x]]) {
      g[x] = f[i - len[fir[x]]] + node(1, i - len[fir[x]]);
      if (x != fir[x]) tense(g[x], g[par[x]]);
      if (~i & 1) tense(f[i], g[x]);
    }
    if ((~i & 1) && s[i] == s[i - 1]) tense(f[i], f[i - 2] + node(0, i - 2));
  }
  if (f[n].val >= INF) {
    puts("-1");
    return 0;
  }
  std::cout << f[n].val << '\n';
  for (int cur = n; cur; cur = f[cur].frm) {
    if (f[cur].frm + 2 < cur || s[cur] != s[cur - 1]) {
      putint((f[cur].frm + 2) >> 1), putchar(' ');
      putint(cur >> 1), putchar('\n');
    }
  }
  return 0;
}

```