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 = 505000;
char In[maxN];
vector<pair<int, int> > A, B, Ans;
void Init(char *S, vector<pair<int, int> > &V);
void PushBack(vector<pair<int, int> > &V, pair<int, int> p);
void Exge(int l);
int main() {
  scanf("%s", In + 1);
  Init(In, A);
  scanf("%s", In + 1);
  Init(In, B);
  int swp = 0;
  if (A.size() > B.size()) swap(A, B), swp = 1;
  if (A.back().first == B.back().first) {
    if ((B.size() - A.size()) % 4 == 3) Exge((B.size() - A.size() + 1) / 4 * 2);
    int l = (B.size() - A.size()) / 4 * 2 + 1;
    A.push_back(make_pair(B[B.size() - l - 1].first, 0));
    Exge(l);
  } else if (B.size() - A.size() > 2)
    Exge((B.size() - A.size() + 1) / 4 * 2 + 1);
  while (A.size() > 1 || B.size() > 1) Exge(1);
  printf("%d\n", (int)Ans.size());
  for (int i = 0, sz = Ans.size(); i < sz; i++)
    swp ? printf("%d %d\n", Ans[i].second, Ans[i].first)
        : printf("%d %d\n", Ans[i].first, Ans[i].second);
  return 0;
}
void Init(char *S, vector<pair<int, int> > &V) {
  for (int i = strlen(S + 1); i >= 1; i--) PushBack(V, make_pair(S[i], 1));
  return;
}
void PushBack(vector<pair<int, int> > &V, pair<int, int> p) {
  if (V.empty() || V.back().first != p.first)
    V.push_back(p);
  else
    V.back().second += p.second;
  return;
}
void Exge(int l) {
  int tl = 0;
  pair<int, int> la = A.back();
  A.pop_back();
  for (int i = l, bsz = B.size(); i >= 1; i--)
    PushBack(A, B[bsz - i]), tl += B[bsz - i].second;
  Ans.push_back(make_pair(la.second, tl));
  for (int i = 1; i <= l; i++) B.pop_back();
  PushBack(B, la);
  return;
}