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;
class Solution {
 public:
  vector<pair<int, int>> construct(string& s, string& t) {
    deque<pair<char, int>> qs;
    deque<pair<char, int>> qt;
    int n = s.length();
    int m = t.length();
    for (int i = 0; i < n; ++i) {
      char c = s[i];
      int cnt = 1;
      while (i + 1 < n && s[i + 1] == c) {
        ++i;
        ++cnt;
      }
      qs.emplace_back(c, cnt);
    }
    for (int i = 0; i < m; ++i) {
      char c = t[i];
      int cnt = 1;
      while (i + 1 < m && t[i + 1] == c) {
        ++i;
        ++cnt;
      }
      qt.emplace_back(c, cnt);
    }
    vector<pair<int, int>> res;
    res.reserve(n + m + 1000);
    while (qs.size() != 1 || qt.size() != 1) {
      assert(qs.size() > 0 && qt.size() > 0);
      if (qs.empty()) {
        int n = qt.size() / 2;
        if (n % 2 == 0 && n + 1 < qt.size()) {
          ++n;
        }
        int cnt = 0;
        while (n-- > 0) {
          cnt += qt.front().second;
          qs.push_back(qt.front());
          qt.pop_front();
        }
        res.emplace_back(0, cnt);
      } else if (qt.empty()) {
        int n = qs.size() / 2;
        if (n % 2 == 0 && n + 1 < qs.size()) {
          ++n;
        }
        int cnt = 0;
        while (n-- > 0) {
          cnt += qs.front().second;
          qt.push_back(qs.front());
          qs.pop_front();
        }
        res.emplace_back(cnt, 0);
      } else if (qs.size() == 1) {
        int n = qt.size() / 2;
        if (n % 2 == 0 && n + 1 < qt.size()) {
          ++n;
        }
        int cnt = 0;
        char c = qs.front().first;
        int cnt1 = qs.front().second;
        qs.pop_front();
        while (n-- > 0) {
          cnt += qt.front().second;
          if (n == 0) {
            if (c == qt.front().first) {
              qs.emplace_back(c, qt.front().second + cnt1);
              qt.pop_front();
              cnt1 = 0;
            } else {
              qs.push_back(qt.front());
              qt.pop_front();
              qt.front().second += cnt1;
            }
            break;
          } else {
            qs.push_back(qt.front());
          }
          qt.pop_front();
        }
        res.emplace_back(cnt1, cnt);
      } else if (qt.size() == 1) {
        int n = qs.size() / 2;
        if (n % 2 == 0 && n + 1 < qs.size()) {
          ++n;
        }
        int cnt = 0;
        char c = qt.front().first;
        int cnt1 = qt.front().second;
        qt.pop_front();
        while (n-- > 0) {
          cnt += qs.front().second;
          if (n == 0) {
            if (qs.front().first == c) {
              qt.emplace_back(c, qs.front().second + cnt1);
              qs.pop_front();
              cnt1 = 0;
            } else {
              qt.push_back(qs.front());
              qs.pop_front();
              qs.front().second += cnt1;
            }
            break;
          } else {
            qt.push_back(qs.front());
          }
          qs.pop_front();
        }
        res.emplace_back(cnt, cnt1);
      } else if (qs.front().first == qt.front().first) {
        if (qs.size() >= 2 && qt.size() >= 2) {
          if (qs.size() >= qt.size()) {
            auto p1 = qs.front();
            qs.pop_front();
            auto p2 = qs.front();
            qs.pop_front();
            auto p3 = qt.front();
            qt.pop_front();
            if (qs.empty()) {
              qs.push_front(p3);
            } else {
              qs.front().second += p3.second;
            }
            qt.front().second += p2.second;
            qt.push_front(p1);
            res.emplace_back(p1.second + p2.second, p3.second);
          } else {
            auto p1 = qs.front();
            qs.pop_front();
            auto p2 = qt.front();
            qt.pop_front();
            auto p3 = qt.front();
            qt.pop_front();
            qs.front().second += p3.second;
            qs.push_front(p2);
            qt.front().second += p1.second;
            res.emplace_back(p1.second, p2.second + p3.second);
          }
        } else {
          if (qs.size() >= qt.size()) {
            res.emplace_back(qs.front().second, 0);
            qt.front().second += qs.front().second;
            qs.pop_front();
          } else {
            res.emplace_back(0, qt.front().second);
            qs.front().second += qt.front().second;
            qt.pop_front();
          }
        }
      } else {
        if (qs.size() > 3 && qt.size() == 2) {
          auto p1 = qs.front();
          qs.pop_front();
          auto p2 = qs.front();
          qs.pop_front();
          auto p3 = qs.front();
          qs.pop_front();
          auto p4 = qt.front();
          qt.pop_front();
          res.emplace_back(p1.second + p2.second + p3.second, p4.second);
          qs.front().second += p4.second;
          qt.front().second += p3.second;
          qt.push_front(p2);
          qt.push_front(p1);
          continue;
        } else if (qs.size() == 2 && qt.size() > 3) {
          auto p1 = qs.front();
          qs.pop_front();
          auto p2 = qt.front();
          qt.pop_front();
          auto p3 = qt.front();
          qt.pop_front();
          auto p4 = qt.front();
          qt.pop_front();
          res.emplace_back(p1.second, p2.second + p3.second + p4.second);
          qs.front().second += p4.second;
          qs.push_front(p3);
          qs.push_front(p2);
          qt.front().second += p1.second;
          continue;
        }
        int cnt = qs.front().second;
        int cnt1 = qt.front().second;
        res.emplace_back(cnt, cnt1);
        qs.pop_front();
        qt.pop_front();
        qs.front().second += cnt1;
        qt.front().second += cnt;
      }
    }
    return res;
  }
};
int main(int argc, char** argv) {
  ios::sync_with_stdio(false);
  cin.tie(0);
  string s, t;
  cin >> s;
  cin >> t;
  Solution sol;
  auto res = sol.construct(s, t);
  cout << res.size() << endl;
  for (auto& p : res) {
    cout << p.first << " " << p.second << endl;
  }
  return 0;
}