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;
using ll = long long;
template <typename S, typename T>
void xmin(S &a, T const &b) {
  if (b < a) a = b;
}
template <typename S, typename T>
void xmax(S &a, T const &b) {
  if (b > a) a = b;
}
int count_flips(string const &s) {
  int ret = 0;
  for (int i = 1; i < (int)s.size(); ++i) {
    if (s[i] != s[i - 1]) {
      ++ret;
    }
  }
  return ret;
}
int kth_flip(string const &s, int k) {
  if (k == 0) {
    return 0;
  }
  --k;
  for (int i = 1; i < (int)s.size(); ++i) {
    if (s[i] != s[i - 1]) {
      if (k == 0) {
        return i;
      }
      --k;
    }
  }
  if (k == 0) {
    return (int)s.size() - 1;
  }
  assert(0);
  return -1;
}
vector<pair<int, int> > finish(string s, string t) {
  vector<pair<int, int> > ret;
  char const x = s.back(), y = t.back();
  assert(x != y);
  for (; !s.empty() || !t.empty();) {
    while (!s.empty() && s.back() == x) s.pop_back();
    while (!t.empty() && t.back() == y) t.pop_back();
    ret.emplace_back(s.size(), t.size());
    s.swap(t);
  }
  ret.pop_back();
  return ret;
}
vector<pair<int, int> > solve(string const &s, string const &t) {
  int x = count_flips(s), y = count_flips(t);
  if (x > y) {
    auto tmp = solve(t, s);
    for (auto &e : tmp) swap(e.first, e.second);
    return tmp;
  }
  assert(x <= y);
  vector<pair<int, int> > ret(s.size() + t.size() + 10, make_pair(-1, -1));
  auto cand = [&](int a, int b) {
    assert(0 <= a && a < (int)s.size());
    assert(0 <= b && b < (int)t.size());
    auto tmp =
        finish(t.substr(0, b) + s.substr(a), s.substr(0, a) + t.substr(b));
    if (a != 0 || b != 0) {
      tmp.insert(tmp.begin(), make_pair(a, b));
    }
    if (tmp.size() < ret.size()) {
      ret = move(tmp);
    }
  };
  for (int i = 0; i <= min(4, x + 1); ++i) {
    const int A = kth_flip(s, i);
    const int m = (y - x + 2 * i) / 2;
    for (int j = max(0, m - 4); j <= min(y + 1, m + 4); ++j) {
      const int B = kth_flip(t, j);
      cand(A, B);
    }
  }
  return ret;
}
signed brute(string const &s, string const &t) {
  set<pair<string, string> > vis;
  queue<pair<string, string> > q;
  auto enqueue = [&](string const &s, string const &t) {
    auto key = make_pair(s, t);
    if (vis.count(key)) return;
    vis.insert(key);
    q.push(key);
  };
  enqueue(s, t);
  q.emplace(string(""), string(""));
  int ret = 0;
  while (q.size() > 1) {
    auto tmp = q.front();
    q.pop();
    if (tmp.first == "" && tmp.second == "") {
      q.emplace(tmp);
      ++ret;
    } else {
      if (tmp.first.find('a') == -1 && tmp.second.find('b') == -1) {
        return ret;
      }
      if (tmp.first.find('b') == -1 && tmp.second.find('a') == -1) {
        return ret;
      }
      for (int i = 0; i <= (int)tmp.first.size(); ++i) {
        for (int j = 0; j <= (int)tmp.second.size(); ++j) {
          enqueue(tmp.second.substr(0, j) + tmp.first.substr(i),
                  tmp.first.substr(0, i) + tmp.second.substr(j));
        }
      }
    }
  }
  assert(0);
  return ret;
}
signed gen(int t) {
  const int n = 100;
  mt19937 rng(5325);
  auto get_rand = [&](int a, int b) {
    return uniform_int_distribution<int>(a, b)(rng);
  };
  auto get_string = [&]() {
    int x = get_rand(1, n);
    string ret;
    for (int i = 0; i < x; ++i) {
      ret += (char)('a' + get_rand(0, 1));
    }
    return ret;
  };
  ofstream o("gen.txt");
  o << t << "\n";
  while (t--) {
    o << get_string() << "\n" << get_string() << "\n";
  }
  o << endl;
  o.close();
  return 0;
}
void check(string s, string t, vector<pair<int, int> > const &v) {
  auto d = [&](int i, int j) {
    assert(0 <= i && i <= s.size());
    assert(0 <= j && j <= t.size());
    string a = s.substr(0, i) + t.substr(j);
    string b = t.substr(0, j) + s.substr(i);
    t = a;
    s = b;
  };
  for (auto const &e : v) {
    d(e.first, e.second);
  }
  if (s.find('a') == -1 && t.find('b') == -1) return;
  if (s.find('b') == -1 && t.find('a') == -1) return;
  assert(0);
}
signed main() {
  cin.tie(0);
  cout.tie(0);
  ios_base::sync_with_stdio(false);
  string s, t;
  cin >> s >> t;
  s += "a";
  t += "b";
  auto ans_1 = solve(s, t);
  swap(s.back(), t.back());
  auto ans_2 = solve(s, t);
  if (ans_1.size() > ans_2.size()) {
    ans_1.swap(ans_2);
    swap(s.back(), t.back());
  }
  cout << ans_1.size() << "\n";
  for (auto &e : ans_1) {
    cout << e.first << " " << e.second << "\n";
  }
  return 0;
}