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 N = 1e6 + 5;
template <typename T>
bool vmin(T &a, T b) {
  return (a > b) ? (a = b, true) : false;
}
inline int cti(char x) { return x - 'a'; }
typedef class TrieNode {
 public:
  pair<int, int> g;
  int len;
  int dif;
  TrieNode *ch[26];
  TrieNode *fail, *slink;
} TrieNode;
TrieNode pool[N];
TrieNode *_top = pool;
TrieNode *newnode(int len) {
  _top->len = len;
  _top->g = pair<int, int>(N, -1);
  return _top++;
}
typedef class PalindromeTree {
 public:
  TrieNode *odd, *even;
  TrieNode *lst;
  int tp;
  char *s;
  PalindromeTree() : odd(newnode(-1)), even(newnode(0)) {
    odd->fail = odd;
    even->fail = odd;
    odd->dif = -1, even->dif = -1;
    odd->slink = even->slink = NULL;
    lst = even;
  }
  void reserve(int len) {
    s = new char[(len + 1)];
    s[0] = 0;
  }
  TrieNode *extend(TrieNode *p) {
    while (s[tp - p->len - 1] ^ s[tp]) p = p->fail;
    return p;
  }
  void extend(char x) {
    s[++tp] = x;
    int c = cti(x);
    TrieNode *&p = lst;
    p = extend(p);
    if (!p->ch[c]) {
      TrieNode *q = extend(p->fail)->ch[c];
      p->ch[c] = newnode(p->len + 2);
      (p = p->ch[c])->fail = q ? q : even;
      p->dif = p->len - p->fail->len;
      p->slink = (p->dif == p->fail->dif) ? (p->fail->slink) : p->fail;
    } else {
      p = p->ch[c];
    }
  }
} PalindromeTree;
int n;
char s[N], t[N];
PalindromeTree pam;
int f[N], ls[N];
int main() {
  scanf("%s%s", s + 1, t + 1);
  n = strlen(s + 1);
  for (int i = 1; i <= (n << 1); i++) {
    f[i] = N;
    ls[i] = -1;
  }
  ls[0] = -1;
  pam.reserve(n << 1);
  for (int i = 1; i <= (n << 1); i++) {
    pam.extend((i & 1) ? (s[(i + 1) >> 1]) : (t[i >> 1]));
    for (TrieNode *p = pam.lst; p && p->len > 0; p = p->slink) {
      int len = p->slink->len + p->dif;
      p->g = pair<int, int>(f[i - len] + (len > 2), i - len);
      if (p->dif == p->fail->dif) {
        pair<int, int> gf = p->fail->g;
        if (i - p->dif - gf.second == 2) {
          gf.first++;
        }
        vmin(p->g, gf);
      }
      if (!(i & 1) && vmin(f[i], p->g.first)) {
        ls[i] = p->g.second;
      }
    }
  }
  int p = n << 1;
  if (f[p] == N) {
    puts("-1");
  } else {
    printf("%d\n", f[p]);
    while (p) {
      if (p - ls[p] > 2) {
        printf("%d %d\n", (ls[p] >> 1) + 1, p >> 1);
      }
      p = ls[p];
    }
  }
  return 0;
}