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 NN = 1000100;
int link[NN], fail[NN], len[NN], dif[NN], nxt[NN][26];
int ed, sz, cur;
char s[NN], S[NN], T[NN];
int tp[NN], dp[NN], pre[NN], pr[NN];
void clear(int u, int L = 0) { len[u] = L; }
void init() {
  sz = 2;
  ed = 1;
  cur = 0;
  s[cur] = -1;
  clear(0);
  clear(1, -1);
  fail[0] = 1;
}
inline int get_fail(int u) {
  while (s[cur - len[u] - 1] != s[cur]) u = fail[u];
  return u;
}
int insert(char c) {
  s[++cur] = c -= 'a';
  ed = get_fail(ed);
  if (!nxt[ed][c]) {
    int p1 = sz++;
    clear(p1, len[ed] + 2);
    fail[p1] = nxt[get_fail(fail[ed])][c];
    nxt[ed][c] = p1;
    dif[p1] = len[p1] - len[fail[p1]];
    if (dif[p1] == dif[fail[p1]])
      link[p1] = link[fail[p1]];
    else
      link[p1] = fail[p1];
  }
  ed = nxt[ed][c];
  return ed;
}
int main() {
  scanf("%s%s", S, T);
  int n = strlen(S);
  init();
  memset(tp, 0x3f, sizeof tp);
  for (int i = 1, now; i <= n * 2; i++) {
    if (i & 1)
      now = insert(S[i - 1 >> 1]);
    else
      now = insert(T[i - 1 >> 1]);
    dp[i] = 0x3f3f3f3f;
    if ((~i & 1) && S[i - 1 >> 1] == T[i - 1 >> 1]) {
      dp[i] = dp[i - 2];
      pre[i] = i - 2;
    }
    for (int u = now; u; u = link[u]) {
      pr[u] = i - len[link[u]] - dif[u];
      tp[u] = dp[pr[u]];
      if (link[u] ^ fail[u]) {
        if (tp[u] > tp[fail[u]]) {
          tp[u] = tp[fail[u]];
          pr[u] = pr[fail[u]];
        }
      }
      if (~i & 1) {
        if (dp[i] > tp[u] + 1) {
          dp[i] = tp[u] + 1;
          pre[i] = pr[u];
        }
      }
    }
  }
  if (dp[n * 2] == 0x3f3f3f3f) return puts("-1");
  vector<pair<int, int>> ans;
  int now = n * 2;
  while (now) {
    int pre = ::pre[now];
    if (now - pre > 2) ans.emplace_back((pre >> 1) + 1, now >> 1);
    now = pre;
  }
  cout << ans.size() << endl;
  for (auto &a : ans) printf("%d %d\n", a.first, a.second);
  return 0;
}