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;
int n, f[N], g[N];
char _s[2][N], s[N];
inline void U(int &a, int &b, int c, int d) {
  if (c < a) a = c, b = d;
}
namespace PaT {
int c[N][26], link[N], len[N], slink[N], diff[N], sf[N][2], sg[N][2], last,
    size;
inline void Init() {
  link[0] = 1;
  len[1] = -1;
  size = 2;
}
inline int GetLink(int v, int pos) {
  while (s[pos - len[v] - 1] != s[pos]) v = link[v];
  return v;
}
inline void Append(int pos) {
  int d = s[pos] - 'a';
  last = GetLink(last, pos);
  if (!c[last][d]) {
    len[size] = len[last] + 2;
    link[size] = c[GetLink(link[last], pos)][d];
    diff[size] = len[size] - len[link[size]];
    slink[size] =
        (diff[size] == diff[link[size]] ? slink[link[size]] : link[size]);
    c[last][d] = size++;
  }
  last = c[last][d];
  f[pos] = 1e9;
  if ((~pos & 1) && s[pos] == s[pos - 1]) f[pos] = f[pos - 2], g[pos] = pos - 2;
  for (int v = last; len[v] > 0; v = slink[v]) {
    int tmp = len[slink[v]] + diff[v];
    sf[v][tmp & 1] = f[pos - tmp];
    sg[v][tmp & 1] = pos - tmp;
    sf[v][~tmp & 1] = 1e9;
    if (diff[v] == diff[link[v]]) {
      U(sf[v][0], sg[v][0], sf[link[v]][diff[v] & 1], sg[link[v]][diff[v] & 1]);
      U(sf[v][1], sg[v][1], sf[link[v]][~diff[v] & 1],
        sg[link[v]][~diff[v] & 1]);
    }
    U(f[pos], g[pos], sf[v][0] + 1, sg[v][0]);
  }
}
}  // namespace PaT
int main() {
  scanf("%s%s", _s[0], _s[1]);
  n = strlen(_s[0]) << 1;
  for (int i = 0; i < n; ++i) s[i + 1] = _s[i & 1][i >> 1];
  PaT::Init();
  for (int i = 1; i <= n; ++i) PaT::Append(i);
  if (f[n] == 1e9) return puts("-1"), 0;
  printf("%d\n", f[n]);
  while (n) {
    if (g[n] + 2 != n || s[n] != s[n - 1])
      printf("%d %d\n", (g[n] >> 1) + 1, n >> 1);
    n = g[n];
  }
  return 0;
}