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 maxlen = 200000 + 10;
char s[maxlen];
char t[maxlen];
vector<pair<char, int> > S, T;
vector<pair<int, int> > ans;
void printvec(vector<pair<char, int> >& vec) {
  for (int i = vec.size(); i--;) printf("%c %d\n", vec[i].first, vec[i].second);
}
void convert(char str[], vector<pair<char, int> >& vec) {
  for (int i = 0; str[i];) {
    int j = i;
    while (str[j] == str[j + 1]) j += 1;
    vec.emplace_back(pair<char, int>(str[i], j - i + 1));
    i = j + 1;
  }
  reverse(vec.begin(), vec.end());
}
bool swapped = false;
void extract(int len, vector<pair<char, int> >& prefix,
             vector<pair<char, int> >& vec) {
  for (int i = len; i--;) prefix.emplace_back(vec[vec.size() - i - 1]);
  while (len--) vec.pop_back();
}
void combine(vector<pair<char, int> >& prefix, vector<pair<char, int> >& vec) {
  if (prefix.empty()) return;
  int i = 0;
  if (prefix[0].first == vec.back().first) {
    vec.back().second += prefix[0].second;
    i = 1;
  }
  while (i != prefix.size()) vec.emplace_back(prefix[i++]);
}
int getlen(vector<pair<char, int> >& vec) {
  int len = 0;
  for (int i = vec.size(); i--;) len += vec[i].second;
  return len;
}
void query(int len_s, int len_t) {
  vector<pair<char, int> > prefix_s;
  vector<pair<char, int> > prefix_t;
  extract(len_s, prefix_s, S);
  extract(len_t, prefix_t, T);
  combine(prefix_t, S);
  combine(prefix_s, T);
  int ans1 = getlen(prefix_s);
  int ans2 = getlen(prefix_t);
  if (swapped) swap(ans1, ans2);
  ans.emplace_back(ans1, ans2);
}
int main() {
  scanf("%s %s", s, t);
  convert(s, S);
  convert(t, T);
  while (!(S.size() == 1) || !(T.size() == 1)) {
    if (S.size() < T.size()) {
      S.swap(T);
      swapped ^= true;
    }
    if (S.back().first != T.back().first) {
      if (T.size() == 1) {
        if (S.size() <= 3) {
          query(1, 1);
        } else {
          query(3, 1);
        }
      } else {
        if (S.size() <= 3) {
          query(1, 1);
        } else if (T.size() == 2) {
          query(3, 1);
        } else {
          query(1, 1);
        }
      }
    } else {
      if (T.size() == 1) {
        if (S.size() <= 3) {
          query(1, 0);
        } else {
          query(3, 0);
        }
      } else {
        if (S.size() == 2) {
          query(1, 0);
        } else if (T.size() == 2) {
          query(2, 1);
        } else {
          query(3, 2);
        }
      }
    }
  }
  printf("%d\n", ans.size());
  for (int i = 0; i < ans.size(); i++)
    printf("%d %d\n", ans[i].first, ans[i].second);
}