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 INF = 1e9;
const int L = 1000010;
const int C = 26;
int n;
char str[L];
pair<int, int> f[L];
inline void applyMin(pair<int, int> &x, pair<int, int> y) {
  if (y < x) x = y;
}
namespace PAM {
int str[L], pos;
int sz, cur;
int trans[L][C];
int len[L];
int fail[L];
int diff[L], slink[L];
pair<int, int> g[L][2];
void init() {
  str[pos = 0] = -1;
  sz = 1;
  cur = 0;
  len[0] = 0;
  len[1] = -1;
  fail[0] = 1;
  g[0][0] = make_pair(0, 0);
  g[0][1] = make_pair(INF, -1);
}
int getFail(int u) {
  while (str[pos - len[u] - 1] != str[pos]) u = fail[u];
  return u;
}
void insert(int c) {
  str[++pos] = c;
  int u = getFail(cur);
  if (!trans[u][c]) {
    int v = ++sz;
    len[v] = len[u] + 2;
    fail[v] = trans[getFail(fail[u])][c];
    trans[u][c] = v;
  }
  cur = trans[u][c];
  diff[cur] = len[cur] - len[fail[cur]];
  if (fail[cur] <= 1)
    slink[cur] = fail[cur];
  else
    slink[cur] = (diff[cur] == diff[fail[cur]]) ? slink[fail[cur]] : fail[cur];
  for (u = cur; len[u] > 0; u = slink[u]) {
    g[u][0] = g[u][1] = make_pair(INF, -1);
    g[u][(len[slink[u]] + diff[u]) & 1] =
        make_pair(f[pos - (len[slink[u]] + diff[u])].first,
                  pos - (len[slink[u]] + diff[u]));
    if (diff[u] == diff[fail[u]]) {
      applyMin(g[u][diff[u] & 1], g[fail[u]][0]);
      applyMin(g[u][diff[u] & 1 ^ 1], g[fail[u]][1]);
    }
    applyMin(f[pos], make_pair(g[u][0].first + 1, g[u][0].second));
  }
}
}  // namespace PAM
void readData() {
  static char s[L], t[L];
  scanf("%s%s", s + 1, t + 1);
  int m = strlen(s + 1);
  n = m * 2;
  for (int i = 1; i <= m; i++) {
    str[(i << 1) - 1] = s[i];
    str[(i << 1)] = t[i];
  }
}
void dp() {
  PAM::init();
  f[0] = make_pair(0, 0);
  for (int i = 1; i <= n; i++) {
    f[i] = make_pair(INF, -1);
    PAM::insert(str[i] - 'a');
    if (i > 1 && str[i] == str[i - 1])
      applyMin(f[i], make_pair(f[i - 2].first, i - 2));
  }
  if (f[n].first == INF) {
    puts("-1");
    return;
  }
  printf("%d\n", f[n].first);
  for (int i = n; i; i = f[i].second) {
    int l = f[i].second, r = i;
    if (r - l > 2) printf("%d %d\n", (l >> 1) + 1, r >> 1);
  }
}
int main() {
  readData();
  dp();
  return 0;
}