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<int, int> > a, b, ops;
bool sw;
inline void d(vector<pair<int, int> > &v, pair<int, int> p) {
  if (v.empty() || v.back().first != p.first)
    v.push_back({p.first, p.second});
  else
    v.back().second += p.second;
}
inline void c(string &s, vector<pair<int, int> > &v) {
  for (int i = s.size() - 1; i >= 0; --i) d(v, {s[i], 1});
}
inline void e(int s1) {
  int s2 = 0;
  pair<int, int> pa = a.back();
  a.pop_back();
  for (int i = s1 - 1; i >= 0; --i) {
    d(a, b[b.size() - i - 1]);
    s2 += b[b.size() - i - 1].second;
  }
  ops.push_back({pa.second, s2});
  for (int i = 0; i < s1; ++i) b.pop_back();
  d(b, pa);
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> s >> t;
  c(s, a);
  c(t, b);
  if (a.size() > b.size()) {
    swap(a, b);
    sw = 1;
  }
  if (a.back().first == b.back().first) {
    if ((b.size() - a.size()) % 4 == 3)
      e((b.size() - a.size() + 1) / 2 / 2 * 2);
    int f = (b.size() - a.size()) / 2 / 2 * 2 + 1;
    a.push_back({b[b.size() - f - 1].first, 0});
    e(f);
  } else if (b.size() - a.size() > 2)
    e((b.size() - a.size() + 1) / 2 / 2 * 2 + 1);
  while (a.size() > 1 || b.size() > 1) e(1);
  cout << ops.size() << "\n";
  for (pair<int, int> op : ops) {
    if (sw) swap(op.first, op.second);
    cout << op.first << " " << op.second << "\n";
  }
}