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 = 1000010;
char s_a[N], s_b[N], S[N];
int n, m, top, m1, f[N], pre[N];
struct PIII {
  int op, k, sz;
} G[N], G1[N];
vector<pair<int, int> > G2[N];
PIII mpp(int a, int b, int c) { return (PIII){a, b, c}; }
void upd(int x, int y, int s) {
  if (f[y] + s < f[x]) f[x] = f[y] + s, pre[x] = y;
}
int main() {
  scanf("%s", s_a + 1);
  scanf("%s", s_b + 1);
  n = strlen(s_a + 1);
  for (int i = 1; i <= n; ++i) S[(i << 1) - 1] = s_a[i], S[i << 1] = s_b[i];
  n <<= 1;
  S[0] = '.';
  f[0] = 0;
  for (int i = 1; i <= n; ++i) f[i] = 1e9;
  for (int i = 2; i <= n; ++i) {
    m1 = 0;
    if (S[i] == S[i - 1]) G1[++m1] = mpp(i - 1, 2, 1);
    for (int j = 1; j <= m; ++j) {
      PIII x = G[j];
      if (x.sz > 1 && S[x.op + x.k - 1] == S[i])
        G1[++m1] = mpp(x.op + x.k - 1, 0, x.sz - 1);
      if (S[x.op - 1] == S[i]) G1[++m1] = mpp(x.op - 1, 0, 1);
    }
    G1[0].op = i;
    for (int j = 1; j <= m1; ++j)
      G1[j].k = (G1[j - 1].op - G1[j].op) / G1[j].sz;
    m = 0;
    for (int j = 1; j <= m1; ++j) {
      if (!m || G1[j].k != G[m].k)
        G[++m] = G1[j];
      else
        G[m].op = G1[j].op, G[m].sz += G1[j].sz;
    }
    if (i & 1) continue;
    if (S[i] == S[i - 1]) upd(i, i - 2, 0);
    for (int j = 1; j <= m; ++j) {
      PIII x = G[j];
      int p = x.op - 1, ed = p + x.k * (x.sz - 1);
      if (f[ed] < f[p]) p = ed;
      int k = x.k;
      if (k & 1) k <<= 1;
      if (x.op + k < ed) {
        int ii = i - k;
        if (!G2[ii].empty()) {
          for (int I = 0; I <= G2[ii].size() - 1; ++I)
            if (G2[ii][I].first == k) {
              if (f[G2[ii][I].second] < f[p]) p = G2[ii][I].second;
              break;
            }
        }
      }
      G2[i].push_back(make_pair(k, p));
      upd(i, p, 1);
    }
  }
  if (f[n] == 1e9)
    printf("%d\n", -1);
  else {
    printf("%d\n", f[n]);
    for (int i = n; i; i = pre[i]) {
      int L = pre[i] / 2 + 1, R = i / 2;
      if (L == R) continue;
      printf("%d %d\n", L, R);
    }
  }
}