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 K = long double;
using ll = long long;
const int maxn = 1000000 + 5, sigma = 26;
int s[maxn], len[maxn], link[maxn], to[maxn][sigma], diff[maxn], slink[maxn];
int n, last, sz;
void init() {
  s[n++] = -1;
  link[0] = 1;
  len[1] = -1;
  sz = 2;
}
int get_link(int v) {
  while (s[n - len[v] - 2] != s[n - 1]) v = link[v];
  return v;
}
void add_letter(int c) {
  s[n++] = c;
  last = get_link(last);
  if (!to[last][c]) {
    len[sz] = len[last] + 2;
    link[sz] = to[get_link(link[last])][c];
    diff[sz] = len[sz] - len[link[sz]];
    if (diff[sz] == diff[link[sz]]) {
      slink[sz] = slink[link[sz]];
    } else {
      slink[sz] = link[sz];
    }
    to[last][c] = sz++;
  }
  last = to[last][c];
}
const int inf = 1000 * 1000 * 1000 + 7;
char fst[maxn], snd[maxn], a[maxn];
int f[maxn], prv[maxn];
pair<int, int> memo[maxn];
pair<int, int> go(int v) {
  int n = ::n - 1;
  memo[v].first = f[n - len[slink[v]] - diff[v]];
  memo[v].second = n - len[slink[v]] - diff[v];
  if (diff[v] == diff[link[v]]) {
    if (memo[link[v]].first < memo[v].first) memo[v] = memo[link[v]];
  }
  return memo[v];
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> fst >> snd;
  int n = 1;
  for (int i = 0; fst[i]; ++i) {
    a[n++] = fst[i];
    a[n++] = snd[i];
  }
  init();
  for (int i = 1; i < n; ++i) {
    f[i] = inf;
    add_letter(a[i]);
    if (i % 2 == 0 && a[i] == a[i - 1]) f[i] = f[i - 2], prv[i] = i - 2;
    for (int now = last; len[now] > 0; now = slink[now]) {
      auto rs = go(now);
      if (i % 2 == 0 && f[i] > rs.first + 1) {
        f[i] = rs.first + 1;
        prv[i] = rs.second;
      }
    }
  }
  if (f[n - 1] == inf) {
    cout << -1 << '\n';
    return 0;
  }
  cout << f[n - 1] << '\n';
  int where = n - 1;
  vector<pair<int, int>> out;
  while (where > 0) {
    int p = prv[where];
    if (where - p > 2) {
      cout << (p + 1) / 2 + 1 << ' ' << where / 2 << '\n';
    }
    where = p;
  }
  return 0;
}