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 main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  string s, t;
  cin >> s >> t;
  vector<pair<int, int> > rs, rt;
  auto preprocess = [](const string& s, vector<pair<int, int> >& out) {
    int curlen = 0;
    char prev = '$';
    for (const auto& c : s) {
      if (c == prev) {
        curlen++;
        continue;
      }
      if (curlen > 0) {
        out.emplace_back(curlen, (int)(prev - 'a'));
      }
      curlen = 1;
      prev = c;
    }
    if (curlen > 0) {
      out.emplace_back(curlen, (int)(prev - 'a'));
    }
    reverse(out.begin(), out.end());
  };
  preprocess(s, rs);
  preprocess(t, rt);
  int swapped = 0;
  if ((int)rs.size() > (int)rt.size()) {
    swap(rs, rt);
    swapped = 1;
  }
  int sbegin = rs.back().second;
  for (auto& p : rs) {
    p.second = (p.second == sbegin);
  }
  for (auto& p : rt) {
    p.second = (p.second == sbegin);
  }
  vector<pair<int, int> > ans;
  auto go = [&](int spre, int tpre) {
    vector<pair<int, int> > tmps, tmpt;
    int ss = 0, st = 0;
    for (int i = 0; i < spre; i++) {
      tmps.push_back(rs.back());
      ss += rs.back().first;
      rs.pop_back();
    }
    for (int i = 0; i < tpre; i++) {
      tmpt.push_back(rt.back());
      st += rt.back().first;
      rt.pop_back();
    }
    if (swapped) {
      swap(ss, st);
    }
    ans.emplace_back(ss, st);
    while (!tmps.empty()) {
      auto p = tmps.back();
      if (!rt.empty() && p.second == rt.back().second) {
        rt.back().first += p.first;
      } else {
        rt.push_back(p);
      }
      tmps.pop_back();
    }
    while (!tmpt.empty()) {
      auto p = tmpt.back();
      if (!rs.empty() && p.second == rs.back().second) {
        rs.back().first += p.first;
      } else {
        rs.push_back(p);
      }
      tmpt.pop_back();
    }
  };
  if ((int)rs.size() == 1) {
    if (rt.back().second) {
      go(0, ((int)rt.size() / 4) * 2 + 1);
    } else {
      if ((int)rt.size() > 1) {
        go(1, ((int)rt.size() / 4) * 2 + 1);
      }
    }
  } else {
    if (rt.back().second) {
      if (((int)rt.size() - (int)rs.size()) % 4 == 3) {
        go(1, 2);
      }
      go(0, (((int)rt.size() - (int)rs.size()) / 4) * 2 + 1);
    } else {
      if (((int)rt.size() - (int)rs.size()) % 4 == 3) {
        go(1, (((int)rt.size() - (int)rs.size()) / 4) * 2 + 3);
      } else {
        go(1, (((int)rt.size() - (int)rs.size()) / 4) * 2 + 1);
      }
    }
  }
  while ((int)rs.size() > 1 || (int)rt.size() > 1) {
    go(1, 1);
  }
  cout << (int)ans.size() << endl;
  for (auto& p : ans) {
    cout << p.first << ' ' << p.second << endl;
  }
  return 0;
}