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;
char stra[1000005];
char strb[1000005];
int allstr[1000005], n;
struct node {
  node *trans[26], *par, *qlink;
  int len, diff, series_ans, pos_of_dp;
} pool[1000005], *last, *tail = pool, *root;
node *newnode(int l) {
  node *res = tail++;
  res->len = l;
  return res;
}
void init() {
  node *zero = newnode(0);
  node *one = newnode(-1);
  zero->par = one;
  zero->qlink = one;
  zero->diff = 0;
  one->diff = 0;
  zero->series_ans = 0x5f5f5f5f;
  one->series_ans = 0x5f5f5f5f;
  root = last = zero;
}
node *get_par(const int &len, node *pos) {
  while (pos && allstr[len - pos->len - 1] != allstr[len]) {
    pos = pos->par;
  }
  return pos;
}
void build_palindrome(const int &e, const int &len) {
  node *cur = get_par(len, last);
  node *now;
  if (!cur->trans[e]) {
    now = newnode(cur->len + 2);
    cur->trans[e] = now;
    node *p = get_par(len, cur->par);
    if (p) now->par = p->trans[e];
    if (!now->par) now->par = root;
    now->diff = now->len - now->par->len;
    if (now->diff != now->par->diff) {
      now->qlink = now->par;
    } else {
      now->qlink = now->par->qlink;
    }
  }
  last = cur->trans[e];
}
int dp[1000005], pre[1000005];
int ans, l[1000005], r[1000005];
void dfs(int pos) {
  if (!pos) return;
  if (pre[pos] != pos - 2) l[++ans] = pre[pos] / 2 + 1, r[ans] = pos / 2;
  dfs(pre[pos]);
}
int main() {
  scanf("%s", stra + 1);
  scanf("%s", strb + 1);
  n = strlen(stra + 1);
  allstr[0] = -1;
  for (int i = 1; i <= n; ++i) {
    allstr[i * 2 - 1] = stra[i] - 'a';
    allstr[i * 2] = strb[i] - 'a';
    dp[i * 2 - 1] = 0x5f5f5f5f;
    dp[i * 2] = 0x5f5f5f5f;
  }
  dp[0] = 0;
  init();
  for (int i = 1; i <= n * 2; i++) {
    build_palindrome(allstr[i], i);
    if (allstr[i] == allstr[i - 1]) {
      dp[i] = dp[i - 2];
      pre[i] = i - 2;
    }
    for (node *p = last; p != root; p = p->qlink) {
      p->series_ans = dp[i - (p->diff + p->qlink->len)];
      p->pos_of_dp = i - (p->diff + p->qlink->len);
      if (p->par->diff == p->diff) {
        if (p->par->series_ans < p->series_ans) {
          p->series_ans = p->par->series_ans;
          p->pos_of_dp = p->par->pos_of_dp;
        }
      }
      if (i % 2 == 0 && p->series_ans + 1 < dp[i]) {
        dp[i] = p->series_ans + 1;
        pre[i] = p->pos_of_dp;
      }
    }
  }
  if (dp[n * 2] >= 0x5f5f5f5f) {
    printf("-1\n");
  } else {
    dfs(n * 2);
    printf("%d\n", ans);
    for (int i = 1; i <= ans; ++i) {
      printf("%d %d\n", l[i], r[i]);
    }
  }
}