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 unsigned long long seed = 13331;
const long long INFLL = 0x3f3f3f3f3f3f3f3fLL;
const int maxn = 1e6 + 7;
const int maxm = 8e6 + 10;
const int INF = 0x3f3f3f3f;
const int mod = 1e9 + 7;
char s[maxn], s1[maxn], s2[maxn];
struct Palindrome_Automaton {
  int len[maxn], next[maxn][26], fail[maxn], cnt[maxn];
  int num[maxn], S[maxn], sz, n, last;
  int diff[maxn];
  int slk[maxn];
  int fp[maxn];
  int newnode(int l) {
    for (int i = 0; i < 26; ++i) next[sz][i] = 0;
    cnt[sz] = num[sz] = 0, len[sz] = l;
    return sz++;
  }
  void init() {
    sz = n = last = 0;
    newnode(0);
    newnode(-1);
    S[0] = -1;
    fail[0] = 1;
  }
  int get_fail(int x) {
    while (S[n - len[x] - 1] != S[n]) x = fail[x];
    return x;
  }
  void add(int c, int pos) {
    c -= 'a';
    S[++n] = c;
    int cur = get_fail(last);
    if (!next[cur][c]) {
      int now = newnode(len[cur] + 2);
      fail[now] = next[get_fail(fail[cur])][c];
      next[cur][c] = now;
      num[now] = num[fail[now]] + 1;
      diff[now] = len[now] - len[fail[now]];
      slk[now] = (diff[now] == diff[fail[now]] ? slk[fail[now]] : fail[now]);
    }
    last = next[cur][c];
    cnt[last]++;
  }
  void solve(int n, int *dp, int *pre) {
    for (int i = 0; i <= n; i++) dp[i] = INF, pre[i] = 0;
    init();
    dp[0] = 0, fp[0] = 1;
    for (int i = 1; i <= n; i++) {
      add(s[i], i);
      for (int j = last; j; j = slk[j]) {
        fp[j] = i - len[slk[j]] - diff[j];
        if (diff[j] == diff[fail[j]] && dp[fp[j]] > dp[fp[fail[j]]])
          fp[j] = fp[fail[j]];
        if (i % 2 == 0 && dp[i] > dp[fp[j]] + 1) {
          dp[i] = dp[fp[j]] + 1;
          pre[i] = fp[j];
        }
      }
      if (i % 2 == 0 && s[i] == s[i - 1] && dp[i] >= dp[i - 2]) {
        dp[i] = dp[i - 2];
        pre[i] = i - 2;
      }
    }
  }
} pam;
int dp[maxn], pre[maxn];
char ss[maxn];
int main() {
  scanf("%s %s", s1 + 1, s2 + 1);
  int n = 2 * strlen(s1 + 1), len1 = 0, len2 = 0;
  for (int i = 1; i <= n; i++) {
    if (i & 1)
      s[i] = s1[++len1];
    else
      s[i] = s2[++len2];
  }
  pam.solve(n, dp, pre);
  if (dp[n] > n)
    return 0 * printf("-1\n");
  else
    printf("%d\n", dp[n]);
  for (int i = n; i; i = pre[i])
    if (i - pre[i] > 2) printf("%d %d\n", pre[i] / 2 + 1, i / 2);
  return 0;
}