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;
using ll = long long;
using vi = vector<int>;
using db = double;
using pii = pair<int, int>;
const int mxn = 500006;
const int MXL = 0x3f3f3f3f;
struct Char {
  char x, y;
  bool operator==(Char b) const { return tie(x, y) == tie(b.y, b.x); }
};
struct Val {
  int x, p;
  bool operator<(Val b) const { return x < b.x; }
};
struct seg {
  int l, r, d;
};
Val f[mxn], g[mxn];
int pfac(Char *s, int n) {
  vector<seg> a, t;
  f[0] = {0, 0};
  for (int i = 1; i <= n; ++i) {
    int p = -MXL;
    t = {};
    auto add = [&](int l, int r, int d) {
      p = r;
      if (t.empty() || t.back().d != d)
        t.push_back({l, r, d});
      else
        t.back().r = r;
    };
    auto add1 = [&](int x) { add(x, x, x - p); };
    for (auto j : a)
      if (j.l > 1 && s[j.l - 1] == s[i]) {
        --j.l;
        --j.r;
        add1(j.l);
        if (j.l < j.r) add(j.l + j.d, j.r, j.d);
      }
    if (i > 1 && s[i - 1] == s[i]) add1(i - 1);
    if (s[i] == s[i]) add1(i);
    a.swap(t);
    f[i] = {MXL};
    if (s[i] == s[i]) f[i] = {f[i - 1].x, i - 1};
    for (auto j : a) {
      auto m = Val{f[j.r - 1].x + 1, j.r - 1};
      if (j.l < j.r) m = min(m, g[j.l - j.d]);
      if (j.d < j.l) g[j.l - j.d] = m;
      f[i] = min(f[i], m);
    }
  }
  return f[n].x;
}
int n;
Char s[mxn];
char a[mxn];
char b[mxn];
int main() {
  scanf("%s", a + 1);
  scanf("%s", b + 1);
  n = strlen(a + 1);
  for (int i = 1; i <= n; ++i) s[i] = {a[i], b[i]};
  int ans = pfac(s, n);
  if (ans == MXL) {
    puts("-1");
    return 0;
  }
  cout << ans << endl;
  for (int i = n; i; i = f[i].p)
    if (i - f[i].p > 1) printf("%d %d\n", f[i].p + 1, i);
  return 0;
}