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>
const int N = 1000005;
int n, len[N], fail[N], lst;
std::string s, t;
int nxt[N][26], buf[N], now;
int anc[N], idx = 1;
int find(int x) {
  while (buf[now] != buf[now - len[x] - 1]) x = fail[x];
  return x;
}
void append(char ch) {
  buf[++now] = ch;
  int cur = find(lst);
  if (!nxt[cur][ch]) {
    int now = ++idx;
    len[now] = len[cur] + 2;
    fail[now] = nxt[find(fail[cur])][ch];
    nxt[cur][ch] = now;
    if (fail[now]) {
      anc[now] = len[now] + len[fail[fail[now]]] == len[fail[now]] * 2
                     ? anc[fail[now]]
                     : now;
    } else
      anc[now] = now;
  }
  lst = nxt[cur][ch];
}
const std::pair<int, int> inf(0x3f3f3f3f, -1);
std::pair<int, int> dp[N], min[N];
std::pair<int, int> operator+(std::pair<int, int> p, int x) {
  return std::pair<int, int>(p.first + x, p.second);
}
int main() {
  std::ios::sync_with_stdio(0), std::cin.tie(0);
  std::cin >> s >> t, n = s.size();
  len[1] = -1, fail[0] = 1;
  for (int i = 1; i <= n * 2; ++i) dp[i] = inf;
  for (int i = 1; i <= n * 2; ++i) {
    append((i & 1 ? s : t)[i - 1 >> 1]);
    for (int p = lst; p > 1; p = fail[anc[p]]) {
      min[p] = anc[p] == p ? inf : min[fail[p]];
      std::pair<int, int> ret = std::min(
          std::pair<int, int>(dp[i - len[anc[p]]].first + 1, i - len[anc[p]]),
          min[p]);
      min[p] = std::min(min[p], ret);
      if (i % 2 == 0) {
        dp[i] = std::min(dp[i], min[p]);
      }
    }
    if (i % 2 == 0 && s[i - 1 >> 1] == t[i - 1 >> 1])
      dp[i] = std::min(dp[i], std::pair<int, int>(dp[i - 2].first, i - 2));
  }
  if (dp[n * 2] == inf)
    std::cout << "-1\n";
  else {
    std::cout << dp[n * 2].first << '\n';
    for (int p = n * 2; p; p = dp[p].second)
      if (p - dp[p].second > 2)
        std::cout << dp[p].second / 2 + 1 << ' ' << p / 2 << '\n';
  }
  return 0;
}