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;
string s, t;
vector<pair<char, int> > a, b;
vector<pair<int, int> > bleach;
bool flag = false;
void add(vector<pair<char, int> > &tren, pair<char, int> s) {
  if (!tren.empty() && tren.back().first == s.first)
    tren.back().second += s.second;
  else
    tren.push_back(s);
}
inline void addchar(vector<pair<char, int> > &tren, char s) {
  add(tren, make_pair(s, 1));
}
int pop(vector<pair<char, int> > &tren, int kol) {
  int sol = 0;
  for (int i = 0; i < kol; i++) {
    sol += tren.back().second;
    tren.erase(tren.end() - 1);
  }
  return sol;
}
void query(int acx, int acy) {
  vector<pair<char, int> > ta, tb;
  for (int i = acx - 1; i >= 0; i--) ta.push_back(a[a.size() - 1 - i]);
  for (int i = acy - 1; i >= 0; i--) tb.push_back(b[b.size() - 1 - i]);
  int kolx = pop(a, acx);
  int koly = pop(b, acy);
  if (flag) swap(kolx, koly);
  bleach.push_back(make_pair(kolx, koly));
  for (int i = 0; i < ta.size(); i++) add(b, ta[i]);
  for (int i = 0; i < tb.size(); i++) add(a, tb[i]);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cin >> s >> t;
  reverse(s.begin(), s.end());
  reverse(t.begin(), t.end());
  for (int i = 0; i < s.size(); i++) addchar(a, s[i]);
  for (int i = 0; i < t.size(); i++) addchar(b, t[i]);
  while (a.size() != 1 || b.size() != 1) {
    int la = a.size();
    int lb = b.size();
    if (la < lb) {
      swap(la, lb);
      swap(a, b);
      flag ^= true;
    }
    const char kuraca = a.back().first;
    const char kuracb = b.back().first;
    if (kuraca != kuracb) {
      if (lb <= 2) {
        if (la <= 3)
          query(1, 1);
        else
          query(3, 1);
      } else
        query(1, 1);
    } else {
      if (lb == 1) {
        if (la <= 3)
          query(1, 0);
        else
          query(3, 0);
      } else if (lb == 2) {
        if (la == 2)
          query(1, 0);
        else
          query(2, 1);
      } else
        query(3, 2);
    }
  }
  printf("%d\n", bleach.size());
  for (int i = 0; i < bleach.size(); i++)
    printf("%d %d\n", bleach[i].first, bleach[i].second);
  return 0;
}