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;
const int mod = 998244353;
const int inf = 1 << 30;
const int maxn = 1000000 + 5;
namespace pam {
int sz, tot, last;
int ch[maxn][26], len[maxn], fail[maxn];
int cnt[maxn], dep[maxn], dif[maxn], slink[maxn];
char s[maxn];
int node(int l) {
  sz++;
  memset(ch[sz], 0, sizeof(ch[sz]));
  len[sz] = l;
  fail[sz] = 0;
  cnt[sz] = 0;
  dep[sz] = 0;
  return sz;
}
void clear() {
  sz = -1;
  last = 0;
  s[tot = 0] = '$';
  node(0);
  node(-1);
  fail[0] = 1;
}
int getfail(int x) {
  while (s[tot - len[x] - 1] != s[tot]) x = fail[x];
  return x;
}
void insert(char c) {
  s[++tot] = c;
  int now = getfail(last);
  if (!ch[now][c - 'a']) {
    int x = node(len[now] + 2);
    fail[x] = ch[getfail(fail[now])][c - 'a'];
    dep[x] = dep[fail[x]] + 1;
    ch[now][c - 'a'] = x;
    dif[x] = len[x] - len[fail[x]];
    if (dif[x] == dif[fail[x]])
      slink[x] = slink[fail[x]];
    else
      slink[x] = fail[x];
  }
  last = ch[now][c - 'a'];
  cnt[last]++;
}
}  // namespace pam
using pam::dif;
using pam::fail;
using pam::len;
using pam::slink;
int n, f[maxn], g[maxn], from[maxn];
char s[maxn], t[maxn];
int main() {
  pam::clear();
  scanf("%s", t + 1);
  n = strlen(t + 1);
  for (int i = 1; i <= n; i++) s[i * 2 - 1] = t[i];
  scanf("%s", t + 1);
  for (int i = 1; i <= n; i++) s[i * 2] = t[i];
  n *= 2;
  for (int i = 1; i <= n; i++) from[i] = f[i] = inf;
  for (int i = 1; i <= n; i++) {
    pam::insert(s[i]);
    if (i % 2 == 0 && s[i] == s[i - 1]) {
      f[i] = f[i - 2];
      from[i] = i - 2;
    }
    for (int x = pam::last; x > 1; x = pam::slink[x]) {
      g[x] = i - len[slink[x]] - dif[x];
      if (dif[x] == dif[fail[x]]) {
        if (f[g[x]] > f[g[fail[x]]]) {
          g[x] = g[fail[x]];
        }
      }
      if (i % 2 == 0) {
        if (f[g[x]] + 1 < f[i]) {
          f[i] = f[g[x]] + 1;
          from[i] = g[x];
        }
      }
    }
  }
  if (f[n] == inf) return puts("-1"), 0;
  printf("%d\n", f[n]);
  for (int i = n; i >= 2; i = from[i]) {
    if (i - from[i] > 2) {
      printf("%d %d\n", from[i] / 2 + 1, i / 2);
    }
  }
  return 0;
}