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 maxn = int(1e6) + 100;
struct tripe {
  int nid, delta, sum;
};
int n;
char st[maxn], str[maxn];
int PL[maxn], GPL[maxn];
int PLpath[maxn], GPLpath[maxn];
void read() {
  char ch;
  while (!isalpha(ch = getchar()))
    ;
  st[n = 1] = ch;
  while (isalpha(ch = getchar())) st[++n] = ch;
  while (!isalpha(ch = getchar()))
    ;
  str[1] = ch;
  for (int i = 2; i <= n; ++i) str[i] = getchar();
  for (int i = n * 2 - 1; i > 0; i -= 2) st[i] = st[(i + 1) / 2];
  for (int i = 1; i <= n; ++i) st[i * 2] = str[i];
  n <<= 1;
}
void solve() {
  memset(PL, 0x7f, sizeof PL);
  memset(GPL, 0x7f, sizeof GPL);
  PL[0] = 0;
  vector<tripe> G;
  G.clear();
  for (int j = 1; j <= n; ++j) {
    vector<tripe> h;
    h.clear();
    int r = -j;
    for (auto &i : G)
      if (i.nid > 1 && st[i.nid - 1] == st[j]) {
        int nid = i.nid - 1;
        if (nid - r != i.delta) {
          h.push_back(tripe{nid, nid - r, 1});
          if (i.sum > 1) h.push_back(tripe{nid + i.delta, i.delta, i.sum - 1});
        } else
          h.push_back(tripe{nid, i.delta, i.sum});
        r = nid + (i.sum - 1) * i.delta;
      }
    if (j > 1 && st[j - 1] == st[j]) {
      h.push_back(tripe{j - 1, j - 1 - r, 1});
      r = j - 1;
    }
    G.clear();
    if (!h.empty()) {
      G.push_back(*h.begin());
      for (vector<tripe>::iterator it = h.begin() + 1; it != h.end(); ++it)
        if (G.back().delta == (*it).delta)
          G.back().sum += (*it).sum;
        else
          G.push_back(*it);
    }
    for (auto &i : G) {
      int r = i.nid + (i.sum - 1) * i.delta;
      int m = PL[r - 1] + 1;
      int pv = r;
      if (i.sum > 1 && GPL[i.nid - i.delta] < m) {
        m = GPL[i.nid - i.delta];
        pv = GPLpath[i.nid - i.delta];
      }
      if (i.delta <= i.nid) {
        GPL[i.nid - i.delta] = m;
        GPLpath[i.nid - i.delta] = pv;
      }
      if (m < PL[j]) {
        PL[j] = m;
        PLpath[j] = pv;
      }
    }
    if (j > 1 && st[j - 1] == st[j] && PL[j - 2] < PL[j]) {
      PL[j] = PL[j - 2];
      PLpath[j] = j - 1;
    }
  }
  if (PL[n] > n)
    printf("-1\n");
  else {
    printf("%d\n", PL[n]);
    for (int i = n; i; i = PLpath[i] - 1)
      if (i - PLpath[i] + 1 != 2 ||
          (i - PLpath[i] + 1 == 2 && st[i - 1] != st[i]))
        printf("%d %d\n", PLpath[i] / 2 + 1, i / 2);
  }
}
int main() {
  read();
  solve();
  return 0;
}