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;
void open(const char *s) {}
int rd() {
  int s, c;
  while ((c = getchar()) < '0' || c > '9')
    ;
  s = c - '0';
  while ((c = getchar()) >= '0' && c <= '9') s = s * 10 + c - '0';
  return s;
}
const int N = 1000010;
char s1[N], s2[N], s[N];
pair<int, int> ans[N];
namespace pam {
int next[N][30];
int fail[N];
int len[N];
int last;
int n;
int cnt;
int a[N];
int diff[N];
int slink[N];
void init() {
  cnt = 1;
  len[1] = -1;
  fail[0] = 1;
  fail[1] = 0;
  diff[0] = -1;
  diff[1] = -1;
  last = 0;
}
void insert(int v) {
  a[++n] = v;
  while (a[n - len[last] - 1] != a[n]) last = fail[last];
  int now = last;
  if (!next[now][v]) {
    int cur = ++cnt;
    len[cur] = len[last] + 2;
    last = fail[last];
    while (a[n - len[last] - 1] != a[n]) last = fail[last];
    fail[cur] = next[last][v];
    diff[cur] = len[cur] - len[fail[cur]];
    if (diff[cur] == diff[fail[cur]])
      slink[cur] = slink[fail[cur]];
    else
      slink[cur] = fail[cur];
    next[now][v] = cur;
  }
  last = next[now][v];
}
pair<int, int> s0[N], s1[N];
void gao(int x) {
  ans[x].first = 0x3fffffff;
  for (int i = last; len[i] > 0; i = slink[i]) {
    s0[i] = s1[i] = pair<int, int>(0x3fffffff, 0);
    if ((x - (len[slink[i]] + diff[i])) & 1)
      s1[i] = pair<int, int>(ans[x - (len[slink[i]] + diff[i])].first,
                             x - (len[slink[i]] + diff[i]));
    else
      s0[i] = pair<int, int>(ans[x - (len[slink[i]] + diff[i])].first,
                             x - (len[slink[i]] + diff[i]));
    if (diff[i] == diff[fail[i]]) {
      s0[i] = min(s0[i], s0[fail[i]]);
      s1[i] = min(s1[i], s1[fail[i]]);
    }
    if (x & 1)
      ans[x] = min(ans[x], pair<int, int>(s1[i].first + 1, s1[i].second));
    else
      ans[x] = min(ans[x], pair<int, int>(s0[i].first + 1, s0[i].second));
  }
}
}  // namespace pam
int main() {
  open("xsy3225");
  scanf("%s", s1 + 1);
  scanf("%s", s2 + 1);
  int n = strlen(s1 + 1);
  for (int i = 1; i <= n; i++) {
    s[2 * i - 1] = s1[i];
    s[2 * i] = s2[i];
  }
  n *= 2;
  pam::init();
  for (int i = 1; i <= n; i++) {
    if (i == 292) int xxx = 1;
    pam::insert(s[i] - 'a' + 1);
    pam::gao(i);
    if (!(i & 1) && s[i - 1] == s[i]) ans[i] = min(ans[i], ans[i - 2]);
  }
  if (ans[n].first >= 0x3fffffff)
    printf("-1\n");
  else {
    printf("%d\n", ans[n].first);
    for (int i = n; i >= 1;)
      if (ans[i].first == ans[i - 2].first && s[i - 1] == s[i])
        i -= 2;
      else {
        printf("%d %d\n", ans[i].second / 2 + 1, i / 2);
        i = ans[i].second;
      }
  }
  return 0;
}