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;
template <class T>
void read(T &res) {
  res = 0;
  T f = 1;
  char c = getchar();
  while (c < '0' || c > '9') {
    if (c == '-') f = -1;
    c = getchar();
  }
  while (c >= '0' && c <= '9') {
    res = res * 10 + c - '0';
    c = getchar();
  }
  res *= f;
}
template <class T>
void out(T x) {
  if (x < 0) {
    putchar('-');
  }
  if (x >= 10) out(x / 10);
  putchar('0' + x % 10);
}
const int inf = 1000000000;
char sa[1000005], sb[1000005], s[1000005];
int N, pre[1000005], tot, l[1000005], r[1000005];
pair<int, int> dp[1000005];
void update(pair<int, int> &a, pair<int, int> b) {
  if (a.first > b.first) a = b;
}
void dfs(int x) {
  if (!x) return;
  int p = dp[x].second;
  if (x - p != 2) l[++tot] = p / 2 + 1, r[tot] = x / 2;
  dfs(p);
}
struct PAM {
  struct node {
    int par, len, nxt[26], spar, diff;
    pair<int, int> sans;
  } tr[1000005];
  int tail, last;
  void Init() {
    tail = 1;
    tr[0].par = 1;
    tr[0].len = 0;
    tr[0].sans = make_pair(inf, -1);
    tr[0].spar = 1;
    tr[1].par = -1;
    tr[1].len = -1;
    tr[1].sans = make_pair(inf, -1);
    tr[1].spar = -1;
  }
  void build(int l) {
    int t = last;
    while (s[l] != s[l - tr[t].len - 1]) t = tr[t].par;
    if (!tr[t].nxt[s[l] - 'a']) {
      int nw = ++tail;
      tr[t].nxt[s[l] - 'a'] = nw;
      tr[nw].len = tr[t].len + 2;
      if (t == 1)
        tr[nw].par = 0;
      else {
        int x = tr[t].par;
        while (s[l] != s[l - tr[x].len - 1]) x = tr[x].par;
        tr[nw].par = tr[x].nxt[s[l] - 'a'];
      }
      tr[nw].diff = tr[nw].len - tr[tr[nw].par].len;
      if (tr[nw].diff == tr[tr[nw].par].diff)
        tr[nw].spar = tr[tr[nw].par].spar;
      else
        tr[nw].spar = tr[nw].par;
      tr[nw].sans = make_pair(inf, 0);
    }
    last = tr[t].nxt[s[l] - 'a'];
    for (int v = last; v >= 2; v = tr[v].spar) {
      int p = l - tr[tr[v].spar].len - tr[v].diff;
      tr[v].sans = make_pair(dp[p].first, p);
      if (tr[v].diff == tr[tr[v].par].diff)
        update(tr[v].sans, tr[tr[v].par].sans);
      pair<int, int> t = tr[v].sans;
      t.first++;
      if (l % 2 == 0) update(dp[l], t);
    }
  }
} pam;
void Solve() {
  scanf("%s", sa + 1);
  scanf("%s", sb + 1);
  N = strlen(sa + 1);
  for (int i = 1; i <= N; ++i) {
    s[i * 2 - 1] = sa[i];
    s[i * 2] = sb[i];
    dp[i * 2 - 1] = make_pair(inf, 0), dp[i * 2] = make_pair(inf, 0);
  }
  pam.Init();
  for (int i = 1; i <= 2 * N; ++i) {
    if (i % 2 == 0 && s[i] == s[i - 1]) {
      dp[i] = make_pair(dp[i - 2].first, i - 2);
    }
    pam.build(i);
  }
  if (dp[2 * N].first > N) {
    puts("-1");
  } else {
    dfs(2 * N);
    out(tot);
    putchar('\n');
    for (int i = 1; i <= tot; ++i) {
      out(l[i]);
      putchar(' ');
      out(r[i]);
      putchar('\n');
    }
  }
}
int main() { Solve(); }