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;
long long read() {
  long long x;
  scanf("%lld", &x);
  return x;
}
const int N = 5.1e5;
const int C = 26;
const int S = 2 * N;
namespace PAM {
struct Node {
  int ch[C], fa;
  int len;
  int d;
  int sf;
  int sv;
  int sid;
} o[S];
int nid;
int ot, et;
void init() {
  nid = 0;
  ot = ++nid;
  o[ot].len = -1;
  et = ++nid;
  o[et].len = 0;
  o[et].fa = ot;
}
int dp[S];
int lf[S];
void build(int a[], int n) {
  init();
  int l = ot;
  for (int i = 0; i < (int)(n); i++) {
    while (i - o[l].len - 1 < 0 || a[i - o[l].len - 1] != a[i]) l = o[l].fa;
    if (o[l].ch[a[i]])
      l = o[l].ch[a[i]];
    else {
      int x = ++nid;
      o[l].ch[a[i]] = x;
      o[x].len = o[l].len + 2;
      if (l != ot) {
        l = o[l].fa;
        while (i - o[l].len - 1 < 0 || a[i - o[l].len - 1] != a[i]) l = o[l].fa;
        assert(o[l].ch[a[i]]);
        l = o[l].ch[a[i]];
      } else {
        l = et;
      }
      o[x].fa = l;
      o[x].d = o[x].len - o[l].len;
      o[x].sf = o[l].len > 0 && o[x].d == o[l].d ? o[l].sf : l;
      l = x;
    }
    dp[i] = INT_MAX >> 1;
    if (i >= 1 && a[i] == a[i - 1]) {
      dp[i] = i <= 1 ? 0 : dp[i - 2];
      lf[i] = i - 2;
    }
    for (int p = l; p != et; p = o[p].sf) {
      int f = o[p].fa;
      int sv = f == o[p].sf ? INT_MAX >> 1 : o[f].sv;
      int sid = i - (o[o[p].sf].len + o[p].d);
      int dsid = sid == -1 ? 0 : dp[sid];
      if (dsid <= sv) {
        o[p].sv = dsid;
        o[p].sid = sid;
      } else {
        o[p].sv = o[f].sv;
        o[p].sid = o[f].sid;
      }
      if (o[p].sv + 1 < dp[i]) {
        dp[i] = o[p].sv + 1;
        lf[i] = o[p].sid;
      }
    }
    if (!(i & 1)) dp[i] = INT_MAX >> 1;
  }
}
}  // namespace PAM
int n;
char s[N], t[N];
int a[S];
int main() {
  scanf("%s", s);
  scanf("%s", t);
  n = strlen(s);
  for (int i = 0; i < (int)(n); i++) a[2 * i] = s[i] - 'a';
  for (int i = 0; i < (int)(n); i++) a[2 * i + 1] = t[i] - 'a';
  PAM::build(a, 2 * n);
  int ans = PAM::dp[2 * n - 1];
  if (ans >= (int)1e9) {
    puts("-1");
    exit(0);
  }
  printf("%d\n", ans);
  int x = 2 * n - 1;
  while (x >= 0) {
    int l = PAM::lf[x];
    if (x - l > 2) printf("%d %d\n", (l + 3) >> 1, (x + 1) >> 1);
    x = l;
  }
  return 0;
}