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 N = 5e5 + 7;
const int M = 100;
char s[N], t[N], str[2 * N];
pair<int, int> PL[2 * N], GPL[2 * N];
tuple<int, int, int> g[M], G[M];
void Palindromic(char *str) {
  const char *S = str - 1;
  int n = strlen(str);
  int G_size = 0;
  PL[0] = {0, 0};
  for (int j = (1); j < (n + 1); ++j) {
    int i, d, k, g_size = 0;
    swap(g_size, G_size);
    for (int _ = (0); _ < (g_size); ++_) g[_] = G[_];
    for (int _ = (0); _ < (g_size); ++_) {
      tie(i, d, k) = g[_];
      if (i > 1 && S[i - 1] == S[j]) G[G_size++] = {i - 1, d, k};
    }
    g_size = 0;
    int r = -j;
    for (int _ = (0); _ < (G_size); ++_) {
      tie(i, d, k) = G[_];
      if (i - r != d) {
        g[g_size++] = {i, i - r, 1};
        if (k > 1) g[g_size++] = {i + d, d, k - 1};
      } else
        g[g_size++] = {i, d, k};
      r = i + (k - 1) * d;
    }
    if (j > 1 && S[j - 1] == S[j]) {
      g[g_size++] = {j - 1, j - 1 - r, 1};
      r = j - 1;
    }
    g[g_size++] = {j, j - r, 1};
    G_size = 0;
    tie(i, d, k) = g[0];
    for (int _ = (1); _ < (g_size); ++_) {
      if (get<1>(g[_]) == d)
        k += get<2>(g[_]);
      else {
        G[G_size++] = {i, d, k};
        tie(i, d, k) = g[_];
      }
    }
    G[G_size++] = {i, d, k};
    PL[j] = {n + 1, 0};
    if (j % 2 == 0 && S[j - 1] == S[j])
      PL[j] = min(PL[j], make_pair(PL[j - 2].first, j - 2));
    for (int _ = (0); _ < (G_size); ++_) {
      tie(i, d, k) = G[_];
      r = i + (k - 1) * d;
      pair<int, int> m = {PL[r - 1].first + 1, r - 1};
      if (k > 1) m = min(m, GPL[i - d]);
      if (d <= i) GPL[i - d] = m;
      if (~j & 1) PL[j] = min(PL[j], m);
    }
  }
}
bool same(int l, int r, const char *s, const char *t) {
  for (int i = (l); i < (r + 1); ++i)
    if (s[i] != t[i]) return false;
  return true;
}
int main() {
  scanf(" %s %s", s, t);
  int n = strlen(s);
  for (int i = (0); i < (n); ++i) {
    str[2 * i] = s[i];
    str[2 * i + 1] = t[i];
  }
  str[2 * n] = 0;
  Palindromic(str);
  if (PL[2 * n].first > n) {
    puts("-1");
  } else {
    vector<pair<int, int> > ans;
    for (int r = 2 * n; r > 0; r = PL[r].second) {
      int L = PL[r].second / 2;
      int R = (r - 1) / 2;
      if (!same(L, R, s, t)) ans.emplace_back(make_pair(L + 1, R + 1));
    }
    printf("%d\n", ans.size());
    for (auto p : ans) printf("%d %d\n", p.first, p.second);
  }
  return 0;
}