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 MAXN = 1e6 + 10;
struct palindromic_tree {
  int slen;
  char str[MAXN];
  int len[MAXN], diff[MAXN];
  int nnodes;
  int link[MAXN], slink[MAXN], nxt[MAXN][26];
  int last;
  string s[MAXN];
  bool dbg;
  palindromic_tree(bool _dbg) {
    str[0] = -1;
    slen = 1;
    link[0] = 1;
    len[1] = -1;
    nnodes = 2;
    dbg = _dbg;
  }
  string getstr(int x) {
    assert(dbg);
    if (x == 0) {
      return "0";
    }
    if (x == 1) {
      return "-1";
    }
    return s[x];
  }
  int getlink(int x) {
    while (str[slen - 2 - len[x]] != str[slen - 1]) {
      x = link[x];
    }
    return x;
  }
  void add(char ch) {
    ch -= 'a';
    str[slen++] = ch;
    last = getlink(last);
    if (!nxt[last][ch]) {
      if (dbg) {
        if (last == 1) {
          s[nnodes] = string(1, ch + 'a');
        } else {
          s[nnodes] = char(ch + 'a') + s[last] + char(ch + 'a');
        }
      }
      len[nnodes] = len[last] + 2;
      link[nnodes] = nxt[getlink(link[last])][ch];
      diff[nnodes] = len[nnodes] - len[link[nnodes]];
      if (diff[nnodes] == diff[link[nnodes]]) {
        slink[nnodes] = slink[link[nnodes]];
      } else {
        slink[nnodes] = link[nnodes];
      }
      nxt[last][ch] = nnodes;
      nnodes++;
    }
    last = nxt[last][ch];
  }
} tr(false);
int N;
char S[MAXN], T[MAXN];
int dp[MAXN], subdp[MAXN];
int dind[MAXN], sind[MAXN];
int main() {
  ios::sync_with_stdio(0);
  scanf("%s %s", S, T);
  N = strlen(S);
  dp[0] = 0;
  for (int i = 1; i <= 2 * N; i++) {
    dp[i] = MAXN;
    if (i % 2 == 1) {
      tr.add(S[i / 2]);
    } else {
      tr.add(T[i / 2 - 1]);
    }
    for (int j = tr.last; tr.len[j] > 0; j = tr.slink[j]) {
      int ind = i - (tr.len[tr.slink[j]] + tr.diff[j]);
      sind[j] = ind;
      subdp[j] = dp[ind];
      if (tr.diff[j] == tr.diff[tr.link[j]]) {
        if (subdp[j] > subdp[tr.link[j]]) {
          subdp[j] = subdp[tr.link[j]];
          sind[j] = sind[tr.link[j]];
        }
      }
      if (dp[i] > subdp[j] + 1) {
        dp[i] = subdp[j] + 1;
        dind[i] = sind[j];
      }
    }
    if (i % 2 == 0 && S[i / 2 - 1] == T[i / 2 - 1]) {
      if (dp[i] > dp[i - 2]) {
        dp[i] = dp[i - 2];
        dind[i] = i - 2;
      }
    }
    if (i % 2 == 1) {
      dp[i] = MAXN;
    }
  }
  if (dp[2 * N] == MAXN) {
    puts("-1");
    return 0;
  }
  printf("%d\n", dp[2 * N]);
  int cur = 2 * N;
  while (cur) {
    if (dp[dind[cur]] != dp[cur]) {
      printf("%d %d\n", dind[cur] / 2 + 1, cur / 2);
    }
    cur = dind[cur];
  }
}