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;
const int INF = 1e9;
const int MAXN = 1000004;
char s[MAXN];
struct PAT {
  int cnt, last;
  int ch[MAXN][26], len[MAXN], fa[MAXN], sz[MAXN];
  int slk[MAXN], diff[MAXN];
  int fp[MAXN];
  int create(int Len, int Fa) {
    fa[cnt] = Fa;
    len[cnt] = Len;
    return cnt++;
  }
  void CLEAR() {
    for (int i = 0; i < cnt; i++) {
      fa[i] = 0;
      len[i] = 0;
      sz[i] = 0;
      slk[i] = 0;
      diff[i] = 0;
      memset(ch[i], 0, sizeof(ch[i]));
    }
    last = 0;
    cnt = 0;
    create(0, 1);
    create(-1, 0);
  }
  int getfail(int p, int n) {
    for (; s[n - len[p] - 1] != s[n]; p = fa[p])
      ;
    return p;
  }
  int add(int c, int pos) {
    int p = getfail(last, pos);
    if (!ch[p][c]) {
      int nt = create(len[p] + 2, ch[getfail(fa[p], pos)][c]);
      ch[p][c] = nt;
      diff[nt] = len[nt] - len[fa[nt]];
      slk[nt] = ((diff[nt] == diff[fa[nt]]) ? slk[fa[nt]] : fa[nt]);
    }
    last = ch[p][c];
    return last;
  }
  void solve(int l, int *dp, int *pre) {
    for (int i = 0; i <= l; i++) {
      pre[i] = 0;
      dp[i] = INF;
    }
    CLEAR();
    dp[0] = 0;
    fp[0] = 1;
    for (int i = 1; i <= l; i++) {
      for (int j = add(s[i] - 'a', i); j; j = slk[j]) {
        fp[j] = i - len[slk[j]] - diff[j];
        if (diff[j] == diff[fa[j]] && dp[fp[j]] > dp[fp[fa[j]]]) {
          fp[j] = fp[fa[j]];
        }
        if (i % 2 == 0 && dp[i] > dp[fp[j]] + 1) {
          dp[i] = dp[fp[j]] + 1;
          pre[i] = fp[j];
        }
      }
      if (i % 2 == 0 && s[i - 1] == s[i] && dp[i] >= dp[i - 2]) {
        dp[i] = dp[i - 2];
        pre[i] = i - 2;
      }
    }
  }
} pat;
char ss[MAXN];
int dp[MAXN], pre[MAXN];
int main() {
  int n;
  scanf("%s", ss + 1);
  n = strlen(ss + 1);
  n <<= 1;
  for (int i = 1; i <= n; i += 2) s[i] = ss[i / 2 + 1];
  scanf("%s", ss + 1);
  for (int i = 2; i <= n; i += 2) s[i] = ss[i / 2];
  pat.solve(n, dp, pre);
  if (dp[n] > n)
    return puts("-1"), 0;
  else
    printf("%d\n", dp[n]);
  for (int i = n; i; i = pre[i]) {
    if (i - pre[i] > 2) printf("%d %d\n", pre[i] / 2 + 1, i / 2);
  }
  return 0;
}