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() {
  char ch = getchar();
  int nega = 1;
  while (!isdigit(ch)) {
    if (ch == '-') nega = -1;
    ch = getchar();
  }
  int ans = 0;
  while (isdigit(ch)) {
    ans = ans * 10 + ch - 48;
    ch = getchar();
  }
  if (nega == -1) return -ans;
  return ans;
}
void print(vector<int> x) {
  for (int i = 0; i < (int)x.size(); i++)
    printf("%d%c", x[i], " \n"[i == (int)x.size() - 1]);
}
char ss[1000005], tt[1000005], s[1000005];
int ch[1000005][26], fa[1000005], len[1000005], dif[1000005], tp[1000005], cnt,
    las, n;
int pos[1000005], p[1000005], f[1000005], fr[1000005];
signed main() {
  scanf("%s%s", ss + 1, tt + 1);
  n = strlen(ss + 1);
  for (int i = 1; i <= n; i++) s[i * 2 - 1] = ss[i], s[i * 2] = tt[i];
  n *= 2;
  cnt = las = 2, len[1] = -1, fa[1] = fa[2] = 1;
  for (int i = 1; i <= n; i++) {
    while (s[i] != s[i - len[las] - 1]) las = fa[las];
    if (!ch[las][s[i] - 'a']) {
      int tmp = fa[las];
      cnt++;
      while (tmp && s[i] != s[i - len[tmp] - 1]) tmp = fa[tmp];
      fa[cnt] = ch[tmp][s[i] - 'a'] ? ch[tmp][s[i] - 'a'] : 2;
      ch[las][s[i] - 'a'] = cnt, len[cnt] = len[las] + 2;
      dif[cnt] = len[cnt] - len[fa[cnt]];
      tp[cnt] = dif[cnt] == dif[fa[cnt]] ? tp[fa[cnt]] : fa[cnt];
    }
    las = ch[las][s[i] - 'a'], pos[i] = las;
  }
  memset(f, 0x3f, sizeof(f));
  f[0] = 0;
  p[1] = p[2] = 1;
  for (int i = 1; i <= n; i++) {
    if (i % 2 == 0 && s[i - 1] == s[i] && f[i - 2] < f[i])
      f[i] = f[i - 2], fr[i] = i - 2;
    for (int j = pos[i]; j > 2; j = tp[j]) {
      p[j] = i - len[tp[j]] - dif[j];
      if (dif[j] == dif[fa[j]] && f[p[fa[j]]] < f[p[j]]) p[j] = p[fa[j]];
      if (i % 2 == 0 && f[p[j]] + 1 < f[i]) f[i] = f[p[j]] + 1, fr[i] = p[j];
    }
  }
  if (f[n] >= 0x3f3f3f3f)
    cout << "-1\n";
  else {
    cout << f[n] << endl;
    int cur = n;
    while (cur) {
      int las = fr[cur];
      if (cur - las > 2) printf("%d %d\n", las / 2 + 1, cur / 2);
      cur = las;
    }
  }
  return 0;
}