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 MAXN = 1e6 + 7;
char s[MAXN], t[MAXN], S[MAXN];
int dp[MAXN], ans[MAXN], pre1[MAXN], pre[MAXN];
int N;
namespace PAM {
int trans[MAXN][26], fa[MAXN], Len[MAXN], anc[MAXN], diff[MAXN];
int cnt, lst;
void init() {
  Len[++cnt] = -1;
  fa[0] = fa[1] = 1;
}
void insert(int pos, int x) {
  int p = lst;
  while (S[pos - Len[p] - 1] != S[pos]) p = fa[p];
  if (trans[p][x]) {
    lst = trans[p][x];
    return;
  }
  int k = ++cnt, tmp = fa[p];
  while (S[pos - Len[tmp] - 1] != S[pos]) tmp = fa[tmp];
  tmp = trans[tmp][x];
  trans[p][x] = k;
  Len[k] = Len[p] + 2;
  fa[k] = tmp;
  diff[k] = Len[k] - Len[tmp];
  anc[k] = diff[k] == diff[tmp] ? anc[tmp] : tmp;
  lst = k;
}
}  // namespace PAM
using namespace PAM;
void output(int x) {
  if (!x) return;
  output(pre[x]);
  if (pre[x] + 1 != x - 1) printf("%d %d\n", pre[x] / 2 + 1, x / 2);
}
int main() {
  memset(dp, 0x3f, sizeof(dp));
  dp[0] = 0;
  scanf("%s %s", s + 1, t + 1);
  N = strlen(s + 1);
  for (int i = 1; i <= N; ++i) S[2 * i - 1] = s[i];
  for (int i = 1; i <= N; ++i) S[2 * i] = t[i];
  init();
  for (int i = 1; i <= 2 * N; ++i) {
    insert(i, S[i] - 'a');
    for (int k = lst; k; k = anc[k]) {
      ans[k] = dp[i - (Len[anc[k]] + diff[k])] + 1;
      pre1[k] = i - (Len[anc[k]] + diff[k]);
      if (anc[k] != fa[k])
        if (ans[k] > ans[fa[k]]) {
          ans[k] = ans[fa[k]];
          pre1[k] = pre1[fa[k]];
        }
      if (!(i & 1))
        if (dp[i] > ans[k]) {
          dp[i] = ans[k];
          pre[i] = pre1[k];
        }
    }
    if (!(i & 1) && S[i] == S[i - 1] && dp[i] > dp[i - 2]) {
      dp[i] = dp[i - 2];
      pre[i] = i - 2;
    }
  }
  if (dp[N * 2] == 0x3f3f3f3f)
    puts("-1");
  else {
    printf("%d\n", dp[N * 2]);
    output(N * 2);
  }
  return 0;
}