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 mod = 1e9 + 7;
const int maxn = 1e6 + 5;
bool update(int &x, int y) {
  if (x > y) {
    x = y;
    return true;
  } else
    return false;
}
struct Palindromic_Tree {
  int next[maxn][26];
  int fail[maxn];
  int len[maxn];
  int S[maxn];
  int last;
  int diff[maxn], slink[maxn], fp[maxn];
  int n;
  int p;
  int newnode(int l) {
    for (int i = 0; i < 26; ++i) next[p][i] = 0;
    len[p] = l;
    return p++;
  }
  void init() {
    p = 0;
    newnode(0);
    newnode(-1);
    last = 0;
    n = 0;
    S[n] = -1;
    fail[0] = 1;
  }
  int get_fail(int x) {
    while (S[n - len[x] - 1] != S[n]) x = fail[x];
    return x;
  }
  int add(int c) {
    c -= 'a';
    S[++n] = c;
    int cur = get_fail(last);
    if (!next[cur][c]) {
      int now = newnode(len[cur] + 2);
      fail[now] = next[get_fail(fail[cur])][c];
      next[cur][c] = now;
      diff[now] = len[now] - len[fail[now]];
      slink[now] =
          (diff[now] == diff[fail[now]] ? slink[fail[now]] : fail[now]);
    }
    last = next[cur][c];
    return last;
  }
  void solve(int dp[], int pre[], char s[], int n) {
    int i, j;
    init();
    dp[0] = 0;
    fp[0] = 1;
    for (i = 1; i <= n; i++) {
      for (j = add(s[i]); j; j = slink[j]) {
        fp[j] = i - (len[slink[j]] + diff[j]);
        if (diff[fail[j]] == diff[j] && dp[fp[j]] > dp[fp[fail[j]]])
          fp[j] = fp[fail[j]];
        if (!(i & 1) && dp[i] > dp[fp[j]] + 1) {
          dp[i] = dp[fp[j]] + 1;
          pre[i] = fp[j];
        }
      }
      if (!(i & 1) && s[i - 1] == s[i] && dp[i] >= dp[i - 2]) {
        dp[i] = dp[i - 2];
        pre[i] = i - 2;
      }
    }
  }
} Pt;
char s1[maxn], s2[maxn], ss[maxn];
int ans[maxn], pre[maxn];
int main() {
  int n, i;
  scanf(" %s", s1);
  scanf(" %s", s2);
  n = strlen(s1);
  for (i = 0; i < n; i++) {
    ss[i * 2 + 1] = s1[i];
    ss[i * 2 + 2] = s2[i];
  }
  n <<= 1;
  memset(ans, 0x3f, sizeof(ans));
  Pt.solve(ans, pre, ss, n);
  if (ans[n] > n) return puts("-1"), 0;
  printf("%d\n", ans[n]);
  for (i = n; i; i = pre[i]) {
    if (i - pre[i] > 2) printf("%d %d\n", pre[i] / 2 + 1, i / 2);
  }
  return 0;
}