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 = 0x3fffffff;
const int SINF = 0x7fffffff;
const long long LINF = 0x3fffffffffffffff;
const long long SLINF = 0x7fffffffffffffff;
const int MAXN = 1000007;
struct sT {
  sT() : b(0), d(0), k(0) {}
  sT(int _b, int _d, int _k) : b(_b), d(_d), k(_k) {}
  int b, d, k;
};
int n;
char ss[MAXN], st[MAXN], s[MAXN];
int dp[MAXN], pdp[MAXN], gpl[MAXN], pgpl[MAXN];
vector<sT> g, g1;
void init();
void input();
void work();
int main() {
  init();
  input();
  work();
}
void init() { ios::sync_with_stdio(false); }
void input() { scanf("%s%s", ss, st); }
void work() {
  int tlen = strlen(ss);
  for (int i = 0; i < tlen; ++i) s[++n] = ss[i], s[++n] = st[i];
  int pre, size, cv, np;
  for (int i = 1; i <= n; ++i) {
    g1.clear();
    pre = -i;
    for (auto x : g) {
      if (x.b > 1 && s[i] == s[x.b - 1]) {
        if (x.b - 1 - pre == x.d)
          g1.push_back(sT(x.b - 1, x.d, x.k));
        else {
          g1.push_back(sT(x.b - 1, x.b - 1 - pre, 1));
          if (x.k > 1) g1.push_back(sT(x.b + x.d - 1, x.d, x.k - 1));
        }
        pre = g1.back().b + g1.back().d * (g1.back().k - 1);
      }
    }
    dp[i] = INF;
    pdp[i] = -1;
    if (i > 1 && s[i] == s[i - 1]) {
      dp[i] = dp[i - 2], pdp[i] = i - 2;
      g1.push_back(sT(i - 1, i - 1 - pre, 1));
    }
    g.clear();
    if (!g1.empty()) {
      g.push_back(g1.front());
      size = g1.size();
      for (int j = 1; j < size; ++j) {
        if (g.back().d == g1[j].d)
          g.back().k += g1[j].k;
        else
          g.push_back(g1[j]);
      }
    }
    for (auto x : g) {
      np = x.b + x.d * (x.k - 1) - 1;
      cv = dp[np] + 1;
      if (x.k > 1) {
        if (gpl[x.b - x.d] < cv) {
          cv = gpl[x.b - x.d];
          np = pgpl[x.b - x.d];
        }
      }
      if (x.b - x.d >= 0) gpl[x.b - x.d] = cv, pgpl[x.b - x.d] = np;
      if (cv < dp[i]) dp[i] = cv, pdp[i] = np;
    }
  }
  if (dp[n] == INF) {
    printf("-1\n");
    return;
  }
  printf("%d\n", dp[n]);
  int cur = n;
  while (cur) {
    if (dp[pdp[cur]] ^ dp[cur])
      printf("%d %d\n", (pdp[cur] + 2) >> 1, (cur + 1) >> 1);
    cur = pdp[cur];
  }
}