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>
const int MAXN = 1e6 + 10;
const int INF = 0x3f3f3f3f;
int nxt[MAXN][26], fail[MAXN], R[MAXN], tot, lst;
char buf[MAXN];
int L;
int find(int x) {
  while (buf[L] != buf[L - 1 - R[x]]) x = fail[x];
  return x;
}
int diff[MAXN], slink[MAXN];
int at[MAXN];
void extend(int x) {
  buf[++L] = x - 'a';
  int now = find(lst), &nt = nxt[now][x];
  if (!nt) {
    int fx = nxt[find(fail[now])][x];
    R[nt = ++tot] = R[now] + 2;
    fail[nt] = fx;
    diff[nt] = R[nt] - R[fx];
    slink[nt] = diff[nt] == diff[fx] ? slink[fx] : nt;
  }
  at[L] = lst = nt;
}
int f[MAXN], frm[MAXN];
std::pair<int, int> g[MAXN];
void gmi(std::pair<int, int>& x, std::pair<int, int> y) {
  if (x > y) x = y;
}
int main() {
  static char S[MAXN], T[MAXN];
  std::ios_base::sync_with_stdio(false), std::cin.tie(0);
  std::cin >> S >> T;
  int _L = strlen(S);
  *buf = 255, R[1] = -1, fail[0] = 1;
  diff[0] = -12243;
  tot = lst = 1;
  for (int i = 0; i < _L; ++i) extend(S[i]), extend(T[i]);
  for (int i = 1; i <= L; ++i) {
    int p = at[i];
    std::pair<int, int> cur(INF, -1);
    while (p) {
      std::pair<int, int> dp =
          slink[p] == p ? std::pair<int, int>(INF, -1) : g[fail[p]];
      int S = slink[p], at = i - R[S];
      std::pair<int, int> tar(f[at] + 1, at);
      if (at & 1) tar.first = INF;
      gmi(g[p] = dp, tar);
      if (i % 2 == 0) gmi(cur, g[p]);
      p = fail[slink[p]];
    }
    if (i % 2 == 0) {
      if (buf[i] == buf[i - 1]) gmi(cur, std::pair<int, int>(f[i - 2], i - 2));
      std::tie(f[i], frm[i]) = cur;
    }
  }
  if (f[L] > L) {
    std::cout << -1 << std::endl;
    exit(0);
  }
  std::cout << f[L] << '\n';
  int now = L;
  while (now) {
    int l = now - frm[now];
    if (l != 2) {
      std::cout << (frm[now] + 2 >> 1) << ' ' << (now >> 1) << '\n';
    }
    assert(l % 2 == 0);
    now = frm[now];
  }
  return 0;
}