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;
const int maxN = 200011;
int n, i, j;
char s[maxN];
vector<pair<int, int> > A, B, aux1, aux2;
vector<pair<int, int> > sol;
int sA, sB, takeA, takeB, grps;
void get_ord(int n, vector<pair<int, int> >& dest) {
  int i, j;
  for (i = 1; i <= n; i = j) {
    for (j = i; j <= n; j++)
      if (s[i] != s[j]) break;
    dest.push_back(make_pair(s[i] - 'a', j - i));
  }
  reverse(dest.begin(), dest.end());
}
void add(vector<pair<int, int> >& from, vector<pair<int, int> >& to) {
  reverse(from.begin(), from.end());
  for (auto e : from) {
    if (!to.empty()) {
      if (to.back().first == e.first) {
        to.back().second += e.second;
        continue;
      }
    }
    to.push_back(e);
  }
  from.clear();
}
void mv(int c1, int c2) {
  int s1, s2;
  int i;
  s1 = s2 = 0;
  aux1 = aux2 = {};
  for (i = 0; i < c1; i++) {
    aux1.push_back(A.back());
    s1 += A.back().second;
    A.pop_back();
  }
  for (i = 0; i < c2; i++) {
    aux2.push_back(B.back());
    s2 += B.back().second;
    B.pop_back();
  }
  add(aux1, B);
  add(aux2, A);
  sol.push_back(make_pair(s1, s2));
}
int get_bestA(int exp) {
  pair<int, int> best = make_pair(1 << 30, -1);
  int a1, a2, b1, b2;
  for (int aux = max(-1, exp - 5); aux <= exp + 5; aux++) {
    if (takeA + 2 * aux > A.size()) continue;
    if (takeA + 2 * aux < 0) continue;
    a1 = takeA + 2 * aux;
    a2 = A.size() - a1;
    b1 = takeB;
    b2 = B.size() - b1;
    int d1 = b1 + a2 - (b1 > 0 && a2 > 0 ? 1 : 0);
    int d2 = a1 + b2 - (a1 > 0 && b2 > 0 ? 1 : 0);
    best = min(best, make_pair(abs(d1 - d2), aux));
  }
  return best.second;
}
int get_bestB(int exp) {
  pair<int, int> best = make_pair(1 << 30, -1);
  int a1, a2, b1, b2;
  for (int aux = max(-1, exp - 5); aux <= exp + 5; aux++) {
    if (takeB + 2 * aux > B.size()) continue;
    if (takeB + 2 * aux < 0) continue;
    a1 = takeA;
    a2 = A.size() - a1;
    b1 = takeB + 2 * aux;
    b2 = B.size() - b1;
    int d1 = b1 + a2 - (b1 > 0 && a2 > 0 ? 1 : 0);
    int d2 = a1 + b2 - (a1 > 0 && b2 > 0 ? 1 : 0);
    best = min(best, make_pair(abs(d1 - d2), aux));
  }
  return best.second;
}
void solve() {
  if (A.size() == 1 && B.size() == 1) return;
  while (A.size() + B.size() > 3) {
    sA = A.size();
    sB = B.size();
    if (A.back().first == B.back().first) {
      if (A.size() == 1 && B.size() == 6) {
        mv(0, 3);
        continue;
      }
      if (A.size() == 6 && B.size() == 1) {
        mv(3, 0);
        continue;
      }
    }
    if (sA < sB) {
      takeA = 1;
      takeB = 1;
      if (A.back().first == B.back().first) {
        sB--;
        takeB++;
      }
      grps = (sB - sA) / 2;
      takeB += 2 * get_bestB((grps / 2) + 0);
    } else {
      takeA = 1;
      takeB = 1;
      if (A.back().first == B.back().first) {
        sA--;
        takeA++;
      }
      grps = (sA - sB) / 2;
      takeA += 2 * get_bestA((grps / 2) + 0);
    }
    mv(takeA, takeB);
  }
  if (A.size() == 1 && B.size() == 1) return;
  if (A.back().first == B.back().first) {
    if (A.size() < B.size())
      mv(0, 1);
    else
      mv(1, 0);
  } else {
    mv(1, 1);
  }
}
int main() {
  scanf("%s\n", s + 1);
  n = strlen(s + 1);
  get_ord(n, A);
  memset(s, 0, sizeof(s));
  scanf("%s\n", s + 1);
  n = strlen(s + 1);
  get_ord(n, B);
  memset(s, 0, sizeof(s));
  solve();
  printf("%d\n", sol.size());
  for (auto e : sol) printf("%d %d\n", e.first, e.second);
  return 0;
}