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;
inline int read() {
  int x = 0, f = 1;
  char c = getchar();
  while (c > '9' || c < '0') {
    if (c == '-') f = -f;
    c = getchar();
  }
  while (c >= '0' && c <= '9') x = x * 10 + c - '0', c = getchar();
  return x * f;
}
int buffer[25];
inline void write(int x) {
  if (x == 0) {
    putchar('0');
    return;
  }
  if (x < 0) putchar('-'), x = -x;
  int top = 0;
  while (x) buffer[++top] = x % 10, x /= 10;
  while (top) putchar(buffer[top] + '0'), top--;
  return;
}
int son[1000005][27];
int len[1000005], fail[1000005];
int tot, la;
char s[1000005];
int sl[1000005], dif[1000005];
int g[1000005];
int dp[1000005], pr[1000005];
inline void New(int &i) { i = ++tot; }
inline int find(int x, int i) {
  return s[i - len[x] - 1] == s[i] ? x : find(fail[x], i);
}
inline void ins(int i) {
  char c = s[i];
  int f = find(la, i);
  if (!son[f][c - 'a']) {
    int x;
    New(x);
    len[x] = len[f] + 2;
    fail[x] = son[find(fail[f], i)][c - 'a'];
    son[f][c - 'a'] = x;
    dif[x] = len[x] - len[fail[x]];
    if (dif[x] == dif[fail[x]])
      sl[x] = sl[fail[x]];
    else
      sl[x] = fail[x];
  }
  la = son[f][c - 'a'];
  return;
}
char a[1000005], b[1000005];
signed main() {
  scanf("%s%s", a + 1, b + 1);
  int n = strlen(a + 1);
  n += n;
  for (int i = 1; i <= n; i++)
    if (i % 2)
      s[i] = a[(i + 1) / 2];
    else
      s[i] = b[(i + 1) / 2];
  tot = 1, dp[0] = 0, len[0] = 0, len[1] = -1, fail[0] = 1, fail[1] = 0;
  g[0] = g[1] = n + 1, dp[n + 1] = 1e9;
  for (int i = 1; i <= n; i++) {
    ins(i), dp[i] = 1e9;
    for (int j = la; j; j = sl[j]) {
      g[j] = i - len[sl[j]] - dif[j];
      if (sl[j] == sl[fail[j]] && dp[g[fail[j]]] < dp[g[j]]) g[j] = g[fail[j]];
      if (i % 2 == 0 && dp[g[j]] + 1 < dp[i])
        dp[i] = dp[g[j]] + 1, pr[i] = g[j];
    }
    if (i % 2 == 0 && s[i] == s[i - 1] && dp[i - 2] < dp[i])
      dp[i] = dp[i - 2], pr[i] = i - 2;
  }
  if (dp[n] > 1e7) {
    puts("-1");
    return 0;
  }
  int now = n;
  write(dp[n]), putchar('\n');
  while (now) {
    int q = pr[now] + 1;
    int l = (q + 2) / 2, r = (now + 1) / 2;
    if (now - q + 1 > 2) write(l), putchar(' '), write(r), putchar('\n');
    now = pr[now];
  }
}