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 maxn = 500500 << 1;
using std::cin;
using std::cout;
char s0[maxn], s1[maxn], s[maxn];
int c[maxn][26], len[maxn], fail[maxn], big_fail[maxn];
int min_dp[maxn];
int tot, last;
int dp[maxn], prev[maxn];
inline void append(char* s) {
  for (; s[-1 - len[last]] != *s;) last = fail[last];
  int& now = c[last][*s - 'a'];
  if (!now) {
    len[now = ++tot] = len[last] + 2;
    int& x = fail[now] = fail[last];
    for (; s[-1 - len[x]] != *s;) x = fail[x];
    x = c[x][*s - 'a'];
    if (x == now) x = 0;
    big_fail[now] =
        len[now] - len[x] == len[x] - len[fail[x]] ? big_fail[x] : x;
  }
  last = now;
}
int n;
int main() {
  fail[0] = 1, len[++tot] = -1;
  std::ios::sync_with_stdio(false), cin.tie(0);
  cin >> s0 >> s1;
  n = strlen(s0) << 1;
  for (int i = 1; i <= n; ++i) {
    s[i] = (i & 1 ? s0 : s1)[i - 1 >> 1];
    append(s + i);
    dp[i] = 1e9;
    if (i % 2 == 0 && s[i] == s[i - 1]) {
      dp[i] = dp[i - 2];
      prev[i] = i - 2;
    }
    for (int x = last; x; x = big_fail[x]) {
      const int final = big_fail[x], prv = fail[x];
      min_dp[x] = i - len[final] - (len[x] - len[prv]);
      if (prv != final && dp[min_dp[prv]] < dp[min_dp[x]])
        min_dp[x] = min_dp[prv];
      if (i % 2 == 0 && dp[min_dp[x]] + 1 < dp[i]) {
        dp[i] = dp[min_dp[x]] + 1;
        prev[i] = min_dp[x];
      }
    }
  }
  if (dp[n] > 1e8) {
    cout << -1 << '\n';
  } else {
    cout << dp[n] << '\n';
    for (int i = n; i; i = prev[i]) {
      if (i - prev[i] > 2) {
        cout << prev[i] / 2 + 1 << ' ' << i / 2 << '\n';
      }
    }
  }
}