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 long long read() {
  long long x = 0;
  bool f = 1;
  char s = getchar();
  while ((s < '0' || s > '9') && s > 0) {
    if (s == '-') f ^= 1;
    s = getchar();
  }
  while (s >= '0' && s <= '9') x = (x << 1) + (x << 3) + s - '0', s = getchar();
  return f ? x : -x;
}
int n, m, id[1000005], dp[1000005], pre[1000005], f[1000005];
char a[1000005], b[1000005], s[1000005];
struct itn {
  int ch[26], len, fail, siz, tf, df;
} td[1000005];
int IN, las;
inline int getf(int x, int n) {
  while (s[n - td[x].len - 1] != s[n]) x = td[x].fail;
  return x;
}
inline void extend(int n) {
  int cur = getf(las, n), np = td[cur].ch[s[n] - 'a'];
  if (!np) {
    np = ++IN, td[np].len = td[cur].len + 2;
    td[np].fail = td[getf(td[cur].fail, n)].ch[s[n] - 'a'];
    td[cur].ch[s[n] - 'a'] = np, td[np].df = td[np].len - td[td[np].fail].len;
    if (td[np].df == td[td[np].fail].df)
      td[np].tf = td[td[np].fail].tf;
    else
      td[np].tf = td[np].fail;
  }
  td[np].siz++, las = np;
}
inline int MIN(int x, int y) { return dp[x] < dp[y] ? x : y; }
int main() {
  IN = 1, las = 0, td[1].len = -1, td[0].fail = td[1].fail = 1;
  scanf("%s\n%s", a + 1, b + 1), m = strlen(a + 1);
  for (int i = 1; i <= m; i++)
    s[++n] = a[i], id[n] = i, s[++n] = b[i], id[n] = i;
  memset(dp, 0x3f, sizeof(dp));
  ;
  memset(f, 0x3f, sizeof(f));
  ;
  dp[0] = 0;
  for (int i = 1; i <= n; i++) {
    extend(i);
    if (i > 1 && s[i] == s[i - 1]) dp[i] = dp[i - 2], pre[i] = i - 2;
    for (int j = las; td[j].len > 0; j = td[j].tf) {
      f[j] = i - td[td[j].tf].len - td[j].df;
      if (td[j].fail != td[j].tf) f[j] = MIN(f[j], f[td[j].fail]);
      if (~i & 1) {
        if (f[j] < i - 2 && dp[f[j]] + 1 < dp[i])
          dp[i] = dp[f[j]] + 1, pre[i] = f[j];
        if (f[j] >= i - 2 && dp[f[j]] < dp[i]) dp[i] = dp[f[j]], pre[i] = f[j];
      }
    }
  }
  if (dp[n] >= dp[n + 1]) {
    printf("-1\n");
    return 0;
  }
  printf("%d\n", dp[n]);
  for (int i = n; i > 0; i = pre[i])
    if (id[pre[i] + 1] < id[i]) printf("%d %d\n", id[pre[i] + 1], id[i]);
  return 0;
}