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 inf = 987654321;
template <typename T>
inline void MIN(T &a, T b) {
  if (b < a) a = b;
}
char s[1001000], ss[1001000];
int fail[1001000], son[1001000][26], len[1001000], tot, lst, diff[1001000],
    slink[1001000];
pair<int, int> f[1001000], g[1001000];
inline void init() {
  fail[0] = fail[1] = tot = 1;
  len[1] = -1;
}
inline void ins(int pos) {
  int p = lst, c = s[pos] - 'a';
  while (s[pos] != s[pos - len[p] - 1]) p = fail[p];
  if (son[p][c]) return lst = son[p][c], void();
  int x = fail[p];
  while (s[pos] != s[pos - len[x] - 1]) x = fail[x];
  int np = ++tot;
  lst = np;
  fail[np] = x = son[x][c];
  len[np] = len[p] + 2;
  son[p][c] = np;
  diff[np] = len[np] - len[x];
  slink[np] = diff[np] == diff[x] ? slink[x] : x;
}
int main() {
  scanf("%s", s + 1);
  scanf("%s", ss + 1);
  int n = strlen(s + 1);
  for (int i = n; i; --i) s[i + i] = ss[i], s[i + i - 1] = s[i];
  n <<= 1;
  init();
  f[0] = make_pair(0, 0);
  for (int i = 1; i <= n; ++i) {
    if (s[i] == s[i - 1])
      f[i] = make_pair(f[i - 2].first, i - 2);
    else
      f[i] = make_pair(inf, 0);
    ins(i);
    for (int p = lst; p; p = slink[p]) {
      g[p] = make_pair(f[i - diff[p] - len[slink[p]]].first,
                       i - diff[p] - len[slink[p]]);
      if (slink[p] != fail[p]) MIN(g[p], g[fail[p]]);
      if (!(i & 1)) MIN(f[i], make_pair(g[p].first + 1, g[p].second));
    }
  }
  if (f[n].first > 1001000) {
    puts("-1");
    return 0;
  }
  printf("%d\n", f[n].first);
  int nw = n;
  while (nw) {
    int to = f[nw].second;
    if (nw - to != 2) printf("%d %d\n", (to >> 1) + 1, nw >> 1);
    nw = to;
  }
  return 0;
}