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;
long long powmod(long long a, long long b) {
  long long res = 1;
  a %= mod;
  assert(b >= 0);
  for (; b; b >>= 1) {
    if (b & 1) res = res * a % mod;
    a = a * a % mod;
  }
  return res;
}
long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
const int N = 1001000, inf = 1 << 30;
pair<int, int> dp[N], pd[N];
int n;
char s[N], p[N], q[N];
struct seg {
  int a, k, sz;
};
vector<seg> G;
void upd(pair<int, int> &a, pair<int, int> b) {
  a.first = min(a.first, b.first);
  a.second = min(a.second, b.second);
}
int main() {
  scanf("%s", p + 1);
  scanf("%s", q + 1);
  int m = strlen(p + 1);
  for (int i = 1; i < 2 * m + 1; i++)
    if (i % 2 == 1)
      s[i] = p[i / 2 + 1];
    else
      s[i] = q[i / 2];
  n = 2 * m;
  dp[0] = make_pair(0, 0);
  for (int j = 1; j < n + 1; j++) {
    vector<seg> G1, G2;
    for (auto p : G) {
      if (p.a > 1 && s[p.a - 1] == s[j])
        G1.push_back((seg){p.a - 1, p.k, p.sz});
    }
    int r = -j;
    for (auto p : G1) {
      if (p.a - r != p.k) {
        G2.push_back((seg){p.a, p.a - r, 1});
        if (p.sz > 1) G2.push_back((seg){p.a + p.k, p.k, p.sz - 1});
      } else
        G2.push_back(p);
      r = p.a + (p.sz - 1) * p.k;
    }
    if (j > 1 && s[j - 1] == s[j])
      G2.push_back((seg){j - 1, j - 1 - r, 1}), r = j - 1;
    G2.push_back((seg){j, j - r, 1});
    G.clear();
    seg ss = G2[0];
    G2.erase(G2.begin());
    for (auto p : G2) {
      if (p.k == ss.k)
        ss.sz += p.sz;
      else
        G.push_back(ss), ss = p;
    }
    G.push_back(ss);
    bool val = 1;
    dp[j] = make_pair(inf, 0);
    if (j % 2 == 1) val = 0;
    if (s[j] == s[j - 1]) dp[j] = make_pair(dp[j - 2].first, j - 2);
    for (auto p : G) {
      r = p.a + (p.sz - 1) * p.k;
      pair<int, int> c = make_pair(dp[r - 1].first + 1, r - 1);
      if (p.sz > 1) c = min(c, pd[p.a - p.k]);
      if (p.k <= p.a) pd[p.a - p.k] = c;
      if (val) dp[j] = min(dp[j], c);
    }
  }
  if (dp[n].first > m)
    puts("-1");
  else {
    printf("%d\n", dp[n].first);
    int u = n;
    while (u) {
      int v = dp[u].second;
      if (v < u - 2) {
        printf("%d %d\n", v / 2 + 1, u / 2);
      }
      u = v;
    }
  }
}