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 long long mod = 1000000007;
inline int pow_(long long a, int n, int p = mod) {
  int r = 1;
  while (n) {
    if (n & 1) r = r * a % p;
    n >>= 1;
    a = a * a % p;
  }
  return r;
}
inline int inv_(int a) { return pow_(a, mod - 2, mod); }
inline int add(int a, int b) {
  a += b;
  if (a >= mod) a -= mod;
  return a;
}
inline void adds(int& a, int b) {
  a += b;
  if (a >= mod) a -= mod;
}
inline int mul(int a, int b) { return a * 1ll * b % mod; }
inline void muls(int& a, int b) { a = a * 1ll * b % mod; }
inline int sub(int a, int b) {
  a -= b;
  if (a < 0) a += mod;
  return a;
}
const int N = 1000000;
char inp[N + 10], tmpInp[N + 10];
struct node {
  int len, link, qlink, diff;
  map<char, int> mp;
};
node* T = new node[N + 10] + 1;
int head = -1, m = 1;
void init() {
  T[-1].len = T[0].link = T[-1].link = -1;
  T[0].len = 0;
  T[0].diff = 1;
  T[-1].diff = 0;
  T[0].qlink = -1;
  T[-1].qlink = -1;
}
inline int len(int nodeIndex) { return T[nodeIndex].len; }
inline int link(int nodeIndex) { return T[nodeIndex].link; }
inline int diff(int nodeIndex) { return T[nodeIndex].diff; }
inline int qlink(int nodeIndex) { return T[nodeIndex].qlink; }
int getParent(int curNode, int idx, char newChar) {
  if (curNode == -1 || inp[idx - len(curNode)] == newChar) return curNode;
  return getParent(link(curNode), idx, newChar);
}
void add(int idx) {
  char newChar = inp[idx];
  int p = getParent(head, idx - 1, newChar);
  auto& mp = T[p].mp;
  if (mp.find(newChar) != mp.end()) {
    head = mp[newChar];
    return;
  }
  mp[newChar] = m;
  node& nd = T[m];
  int newLink =
      p == -1 ? 0 : T[getParent(link(p), idx - 1, newChar)].mp[newChar];
  nd.len = len(p) + 2;
  nd.link = newLink;
  nd.diff = nd.len - len(newLink);
  nd.qlink = nd.diff != diff(newLink) ? newLink : qlink(newLink);
  head = m++;
}
int dp[N + 10], adp[N + 10];
int lastLen[N + 10];
int adp0[N + 10];
std::pair<int, int> get(int curNode, int n) {
  adp0[curNode] = n - (max(0, len(qlink(curNode))) + diff(curNode));
  adp[curNode] = dp[adp0[curNode]];
  if (link(curNode) != qlink(curNode) && adp[link(curNode)] < adp[curNode]) {
    adp[curNode] = adp[link(curNode)];
    adp0[curNode] = adp0[link(curNode)];
  }
  return n % 2 ? make_pair<int>(mod, -1)
               : make_pair(adp[curNode] + 1, n - adp0[curNode]);
}
int solve(int n) {
  init();
  cerr << inp + 1 << "\n";
  adp[0] = mod;
  for (int i = 1; i <= (n); ++i) {
    add(i);
    int curNode = head;
    dp[i] = mod;
    while (len(curNode) > 0) {
      std::pair<int, int> tmpVal = get(curNode, i);
      if (tmpVal.first < dp[i]) {
        dp[i] = min(dp[i], tmpVal.first);
        lastLen[i] = tmpVal.second;
      }
      curNode = qlink(curNode);
    }
    if (i % 2 == 0 && inp[i] == inp[i - 1] && dp[i - 2] <= dp[i]) {
      dp[i] = dp[i - 2];
      lastLen[i] = 2;
    }
  }
  return dp[n];
}
void printAns(int n) {
  vector<std::pair<int, int> > v;
  while (n > 1) {
    if (dp[n] != dp[n - 2]) v.push_back(make_pair(n - lastLen[n], lastLen[n]));
    n -= lastLen[n];
  }
  for (std::pair<int, int> p : v) {
    printf("%d %d\n", p.first / 2 + 1, p.first / 2 + p.second / 2);
  }
}
int main() {
  scanf("%s", tmpInp);
  int n = strlen(tmpInp);
  scanf("%s", tmpInp + n);
  for (int i = 0; i < (n); ++i)
    inp[i * 2 + 1] = tmpInp[i], inp[2 * (i + 1)] = tmpInp[i + n];
  int ans = solve(n << 1);
  if (ans >= mod) {
    puts("-1");
    return 0;
  }
  printf("%d\n", ans);
  printAns(n << 1);
  return 0;
}