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;
int get(int x1, int x2, int s1, int s2) {
  if (x1 != x2) return max(x1, x2) - 1;
  return s1 == s2 ? x1 : x1 - 1;
}
const int N = 220000;
vector<pair<int, int> > vec[4];
char s[2][N];
int len[2], f[2];
int main() {
  for (int i = 0; i < 2; i++) {
    scanf("%s", s[i]);
    len[i] = strlen(s[i]);
    int seg = 0;
    for (int j = 0; j < len[i]; j++) {
      seg++;
      if (j == len[i] - 1 || s[i][j] != s[i][j + 1]) {
        vec[i].push_back(make_pair(seg, s[i][j] - 'a'));
        seg = 0;
      }
    }
  }
  int sz = vec[0].size() + vec[1].size();
  if (sz == 2) return puts("0"), 0;
  int mi = 1000000, pi, pj;
  for (int i = 0; i <= vec[0].size(); i++) {
    int rem = int(vec[0].size()) - i;
    int l = (i + int(vec[1].size()) - rem) / 2;
    for (int j = max(0, l - 3); j <= min(int(vec[1].size()), l + 3); j++) {
      if (i == vec[0].size() && j == vec[1].size()) continue;
      int x1 =
          i + int(vec[1].size()) - j -
          (i && vec[1].size() != j && vec[0][i - 1].second == vec[1][j].second);
      int x2 =
          j + int(vec[0].size()) - i -
          (j && vec[0].size() != i && vec[0][i].second == vec[1][j - 1].second);
      if (abs(x1 - x2) <= 1 &&
          get(x1, x2, j ? vec[1][0].second : vec[0][i].second,
              i ? vec[0][0].second : vec[1][j].second) +
                  (i || j) <
              mi) {
        mi = get(x1, x2, j ? vec[1][0].second : vec[0][i].second,
                 i ? vec[0][0].second : vec[1][j].second) +
             (i || j);
        pi = i, pj = j;
      }
    }
  }
  printf("%d\n", mi);
  int c0 = 0, c1 = 0;
  for (int i = 0; i < pi; i++) {
    c0 += vec[0][i].first, vec[3].push_back(vec[0][i]);
  }
  for (int j = 0; j < pj; j++) {
    c1 += vec[1][j].first, vec[2].push_back(vec[1][j]);
  }
  if (c0 + c1) printf("%d %d\n", c0, c1);
  for (int i = pi; i < vec[0].size(); i++) vec[2].push_back(vec[0][i]);
  for (int j = pj; j < vec[1].size(); j++) vec[3].push_back(vec[1][j]);
  vec[0].clear(), vec[1].clear();
  for (int i = 2; i <= 3; i++) {
    for (int j = 0; j < vec[i].size(); j++) {
      if (j + 1 != vec[i].size() && vec[i][j].second == vec[i][j + 1].second) {
        vec[i - 2].push_back(
            make_pair(vec[i][j].first + vec[i][j + 1].first, vec[i][j].second));
        j++;
        continue;
      }
      vec[i - 2].push_back(vec[i][j]);
    }
  }
  for (int i = 0; i < 2; i++) reverse(vec[i].begin(), vec[i].end());
  if (vec[0].back().second != vec[1].back().second) {
    while (vec[0].size() + vec[1].size() > 2) {
      for (int i = 0; i < 2; i++) f[i] = vec[i].back().first;
      printf("%d %d\n", f[0], f[1]);
      for (int i = 0; i < 2; i++) vec[i].pop_back();
      for (int i = 0; i < 2; i++)
        if (!vec[i].empty()) vec[i].back().first += f[!i];
    }
    return 0;
  }
  bool flg = false;
  if (vec[0].size() >= vec[1].size()) {
    f[0] = vec[0].back().first;
    printf("%d 0\n", f[0]);
    vec[0].pop_back();
    vec[1].back().first += f[0];
    flg = true;
  }
  if (!flg) {
    f[1] = vec[1].back().first;
    printf("0 %d\n", f[1]);
    vec[1].pop_back();
    vec[0].back().first += f[1];
  }
  while (vec[0].size() + vec[1].size() > 2) {
    for (int i = 0; i < 2; i++) f[i] = vec[i].back().first;
    printf("%d %d\n", f[0], f[1]);
    for (int i = 0; i < 2; i++) vec[i].pop_back();
    for (int i = 0; i < 2; i++)
      if (!vec[i].empty()) vec[i].back().first += f[!i];
  }
  return 0;
}