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;
char str[N], t[N];
char s[N];
pair<int, int> PL[N], GPL[N];
int pos[N];
struct node {
  int i, d, k;
};
vector<node> G, G1, G2;
int main() {
  scanf("%s%s", str + 1, t + 1);
  int n = strlen(str + 1);
  n *= 2;
  for (int i = 1; i <= n; i++) {
    if (i & 1)
      s[i] = str[i / 2 + 1];
    else
      s[i] = t[i / 2];
  }
  PL[0] = make_pair(0, 0);
  for (int j = 1; j <= n; j++) {
    G1.clear();
    for (auto it : G) {
      if (it.i > 1 && s[it.i - 1] == s[j]) {
        G1.push_back((node){it.i - 1, it.d, it.k});
      }
    }
    G2.clear();
    int r = -j;
    for (auto it : G1) {
      if (it.i - r != it.d) {
        G2.push_back((node){it.i, it.i - r, 1});
        if (it.k > 1) G2.push_back((node){it.i + it.d, it.d, it.k - 1});
      } else
        G2.push_back(it);
      r = it.i + (it.k - 1) * it.d;
    }
    if (j > 1 && s[j - 1] == s[j]) {
      G2.push_back((node){j - 1, j - 1 - r, 1});
      r = j - 1;
    }
    G2.push_back((node){j, j - r, 1});
    G.clear();
    node now = G2[0];
    for (int i = 1; i < G2.size(); i++) {
      if (now.d == G2[i].d)
        now.k += G2[i].k;
      else {
        G.push_back(now);
        now = G2[i];
      }
    }
    G.push_back(now);
    bool ok = 1;
    PL[j] = make_pair(1e9, 0);
    if (j % 2 == 1) ok = 0;
    if (j > 1 && s[j] == s[j - 1]) PL[j] = make_pair(PL[j - 2].first, j - 2);
    for (auto it : G) {
      r = it.i + (it.k - 1) * it.d;
      pair<int, int> c = make_pair(PL[r - 1].first + 1, r - 1);
      if (it.k > 1) c = min(c, GPL[it.i - it.d]);
      if (it.d <= it.i) GPL[it.i - it.d] = c;
      if (ok) PL[j] = min(PL[j], c);
    }
  }
  if (PL[n].first > n / 2)
    puts("-1");
  else {
    printf("%d\n", PL[n].first);
    int u = n;
    while (u) {
      int v = PL[u].second;
      if (u - v > 2) {
        printf("%d %d\n", v / 2 + 1, u / 2);
      }
      u = v;
    }
  }
}