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>
inline void read(T& x) {
  int f = 1;
  x = 0;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  x *= f;
}
const int N = 1000000 + 5;
int n, m, L, sz, last;
int ch[N][26];
int link[N], slink[N], len[N];
int sa[N], sg[N], diff[N];
int f[N], g[N];
char s[N], t[N], S[N];
void PAM_init() {
  S[0] = -1;
  last = 0;
  n = 0, sz = 1;
  len[0] = 0;
  len[1] = -1;
  link[0] = 1;
}
int get_link(int x) {
  while (S[n - len[x] - 1] != S[n]) x = link[x];
  return x;
}
void add(int c) {
  S[++n] = c;
  last = get_link(last);
  if (!ch[last][c]) {
    ++sz;
    len[sz] = len[last] + 2;
    link[sz] = ch[get_link(link[last])][c];
    diff[sz] = len[sz] - len[link[sz]];
    if (diff[sz] == diff[link[sz]])
      slink[sz] = slink[link[sz]];
    else
      slink[sz] = link[sz];
    ch[last][c] = sz;
  }
  last = ch[last][c];
}
void print(int x) {
  if (x == 0) return;
  print(g[x]);
  if (x - g[x] != 2) {
    printf("%d %d\n", (g[x] + 2) / 2, (x + 1) / 2);
  }
}
int main() {
  scanf("%s", s + 1);
  scanf("%s", t + 1);
  L = strlen(s + 1);
  PAM_init();
  f[0] = 0;
  memset(sa, 0x3f, sizeof sa);
  for (int i = 1; i <= 2 * L; i++) {
    if (i & 1)
      add(s[(i - 1) / 2 + 1] - 'a');
    else
      add(t[(i - 1) / 2 + 1] - 'a');
    f[i] = 0x3f3f3f3f;
    for (int v = last; len[v] > 0; v = slink[v]) {
      sa[v] = f[i - (len[slink[v]] + diff[v])];
      sg[v] = i - (len[slink[v]] + diff[v]);
      if (diff[v] == diff[link[v]]) {
        if (sa[v] > sa[link[v]] ||
            (sa[v] == sa[link[v]] && sg[v] < sg[link[v]])) {
          sa[v] = sa[link[v]];
          sg[v] = sg[link[v]];
        }
      }
      if (sa[v] < f[i] || (sa[v] == f[i] && g[i] < sg[v])) {
        f[i] = sa[v];
        g[i] = sg[v];
      }
    }
    f[i]++;
    if (i & 1) f[i] = 0x3f3f3f3f, g[i] = 0x3f3f3f3f;
    if (((i & 1) == 0) && S[n] == S[n - 1] && f[i - 2] < f[i]) {
      f[i] = f[i - 2];
      g[i] = i - 2;
    }
  }
  if (f[2 * L] >= 0x3f3f3f3f) {
    printf("-1\n");
    return 0;
  }
  printf("%d\n", f[2 * L]);
  print(2 * L);
  return 0;
}