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;
inline int read() {
  int x = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  return x * f;
}
char s[1000005], t[1000005], w[1000005];
namespace PalindromicAutoMaton {
int trie[1000005][26], len[1000005], fail[1000005], cnt[1000005],
    chain[1000005];
int d[1000005], top[1000005];
int tot, last;
int now;
void Build() {
  tot = 1;
  len[0] = 0;
  fail[0] = 1;
  len[1] = -1;
  fail[1] = 0;
  last = 0;
  now = 0;
}
int New(int l) {
  tot++;
  memset(trie[tot], 0, sizeof(trie[tot]));
  len[tot] = l, fail[tot] = 0;
  return tot;
}
int GetFail(int x) {
  while (w[now - len[x] - 1] != w[now]) x = fail[x];
  return x;
}
void Add(int ch) {
  now++;
  int cur = GetFail(last);
  if (!trie[cur][ch]) {
    int nd = New(len[cur] + 2);
    fail[nd] = trie[GetFail(fail[cur])][ch];
    chain[nd] = chain[fail[nd]] + 1;
    d[nd] = len[nd] - len[fail[nd]];
    top[nd] = (d[nd] == d[fail[nd]] ? top[fail[nd]] : fail[nd]);
    trie[cur][ch] = nd;
  }
  cnt[trie[cur][ch]]++;
  last = trie[cur][ch];
}
}  // namespace PalindromicAutoMaton
using namespace PalindromicAutoMaton;
int Min[1000005], dp[1000005], hd[1000005], to[1000005];
bool Check(int l, int r) {
  for (int i = l; i <= r; ++i) {
    if (s[i] != t[i]) return false;
  }
  return true;
}
int ansL[1000005], ansR[1000005];
int main() {
  scanf("%s", s + 1);
  scanf("%s", t + 1);
  int n = strlen(s + 1);
  int cnt = 0;
  for (int i = 1; i <= n; ++i) {
    w[++cnt] = s[i], w[++cnt] = t[i];
  }
  n *= 2;
  Build();
  for (int i = 1; i <= n; ++i) {
    dp[i] = 0x3f3f3f3f;
  }
  for (int i = 1; i <= n; ++i) {
    Add(w[i] - 'a');
    for (int p = last; p > 1; p = top[p]) {
      hd[p] = i - len[top[p]] - d[p];
      if (d[p] == d[fail[p]] && dp[hd[fail[p]]] < dp[hd[p]]) {
        hd[p] = hd[fail[p]];
      }
      if (i % 2 == 0 && dp[hd[p]] + 1 < dp[i]) {
        dp[i] = dp[hd[p]] + 1;
        to[i] = hd[p];
      }
    }
    if (i % 2 == 0 && w[i] == w[i - 1]) {
      dp[i] = dp[i - 2];
      to[i] = i - 2;
    }
  }
  if (dp[n] > n) {
    puts("-1");
    return 0;
  }
  int ans = 0;
  for (int i = n; i; i = to[i]) {
    int L = to[i] / 2 + 1, R = i / 2;
    if (L == R) continue;
    ansL[++ans] = L, ansR[ans] = R;
  }
  printf("%d\n", ans);
  for (int i = 1; i <= ans; ++i) {
    printf("%d %d\n", ansL[i], ansR[i]);
  }
  return 0;
}