Problem: There are two strings s and t, consisting only of letters a and b. You can make the following operation several times: choose a prefix of s, a prefix of t and swap them. Prefixes can be empty, also a prefix can coincide with a whole string. 

Your task is to find a sequence of operations after which one of the strings consists only of a letters and the other consists only of b letters. The number of operations should be minimized.

Input

The first line contains a string s (1 ≤ |s| ≤ 2·105).

The second line contains a string t (1 ≤ |t| ≤ 2·105).

Here |s| and |t| denote the lengths of s and t, respectively. It is guaranteed that at least one of the strings contains at least one a letter and at least one of the strings contains at least one b letter.

Output

The first line should contain a single integer n (0 ≤ n ≤ 5·105) — the number of operations.

Each of the next n lines should contain two space-separated integers ai, bi — the lengths of prefixes of s and t to swap, respectively.

If there are multiple possible solutions, you can print any of them. It's guaranteed that a solution with given constraints exists.

Examples

Input

bab
bb


Output

2
1 0
1 3


Input

bbbb
aaa


Output

0

Note

In the first example, you can solve the problem in two operations:

  1. Swap the prefix of the first string with length 1 and the prefix of the second string with length 0. After this swap, you'll have strings ab and bbb. 
  2. Swap the prefix of the first string with length 1 and the prefix of the second string with length 3. After this swap, you'll have strings bbbb and a. 



In the second example, the strings are already appropriate, so no operations are needed.

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
using pi = pair<bool, int>;
using dp = deque<pi>;
using dpt = dp::iterator;
const int ML = 2e5 + 100;
char I[ML];
void in(bool* s, dp& u, int& S) {
  scanf(" %s", I);
  for (S = 0; I[S] != '\0'; S++) {
    s[S] = I[S] == 'b';
    if (not u.empty() and u.back().first == s[S])
      u.back().second++;
    else
      u.push_back({s[S], 1});
  }
}
void flip(dp& a, dp& b, int A, int B) {
  assert(A <= a.size() and B <= b.size());
  dp c, d;
  for (int i = 0; i < A; i++) c.push_back(a.front()), a.pop_front();
  for (int i = 0; i < B; i++) d.push_back(b.front()), b.pop_front();
  for (int i = 0; i < A; i++)
    (b.empty() or b.front().first != c.back().first ? b.push_front(c.back()),
     0 : b.front().second += c.back().second),
        c.pop_back();
  for (int i = 0; i < B; i++)
    (a.empty() or a.front().first != d.back().first ? a.push_front(d.back()),
     0 : a.front().second += d.back().second),
        d.pop_back();
  assert(c.empty() and d.empty());
}
using i2 = array<int, 2>;
const int MN = 5e5 + 100;
i2 f[MN];
int N;
void add(int a, int b) { f[N++] = {a, b}; }
void fin() {
  printf("%d\n", N);
  for (int i = 0; i < N; i++) printf("%d %d\n", f[i][0], f[i][1]);
}
bool s[ML], t[ML];
dp u, v;
int S, T, A, B, C;
void greedy() {
  if (u.front().first == v.front().first) {
    if (u.size() < v.size())
      add(0, v.front().second), u.front().second += v.front().second,
          v.pop_front();
    else
      add(u.front().second, 0), v.front().second += u.front().second,
          u.pop_front();
  }
  A = B = 0;
  int i = 1;
  if (u.size() < v.size())
    for (dpt a = u.begin(), b = v.begin(); i < v.size();
         i++, b++, (a != u.end() ? a++ : a))
      add(A += (a != u.end() ? a->second : 0), B += b->second), swap(A, B);
  else
    for (dpt a = u.begin(), b = v.begin(); i < u.size();
         i++, a++, (b != v.end() ? b++ : b))
      add(A += a->second, B += (b != v.end() ? b->second : 0)), swap(A, B);
}
int F, X, Y, L;
void rp(int a, int b, int c) {
  if (a < F) F = a, X = b, Y = c;
}
void pick(const dp& a, const dp& b) {
  F = max(u.size() - 1, v.size() - 1) +
      (u.size() == v.size() and u.front().first == v.front().first),
  X = Y = -1;
  if (a.front().first == b.front().first) {
    if (a.size() < b.size()) {
      L = (b.size() - a.size() + 1) >> 1;
      rp(max(b.size() - L, a.size() + L - 1),
         not(a.front().first xor b.front().first xor (L & 1)), L);
    } else {
      L = (a.size() - b.size() + 1) >> 1;
      rp(max(a.size() - L, b.size() + L - 1), L,
         not(a.front().first xor b.front().first xor (L & 1)));
    }
  } else {
    if (a.size() < b.size()) {
      L = (b.size() - a.size() + 1) >> 1 | 1;
      rp(max(b.size() - L, a.size() + L - 2), 1, L);
    } else {
      L = (a.size() - b.size() + 1) >> 1 | 1;
      rp(max(a.size() - L, b.size() + L - 2), L, 1);
    }
  }
}
int main() {
  in(s, u, S), in(t, v, T);
  pick(u, v);
  if (X == -1)
    greedy();
  else {
    int F1, F2;
    F1 = F2 = 0;
    for (int i = 0; i < X; i++) F1 += u[i].second;
    for (int i = 0; i < Y; i++) F2 += v[i].second;
    add(F1, F2);
    flip(u, v, X, Y);
    greedy();
  }
  fin();
  return 0;
}