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;
long long gcd(long long a, long long b) {
  if (b == 0) {
    return a;
  }
  return gcd(b, a % b);
}
void cruel(string s, string t, vector<pair<int, int> > &out) {
  int n = s.size() + t.size() + 2;
  vector<int> sr(n);
  int srealength = 0;
  for (int i = 0; i < s.size(); i += 1) {
    if ((s[i] - 'a') % 2 != srealength % 2) {
      srealength++;
    }
    sr[srealength]++;
  }
  vector<int> tr(n);
  int trealength = 0;
  for (int i = 0; i < t.size(); i += 1) {
    if ((t[i] - 'a') % 2 != trealength % 2) {
      trealength++;
    }
    tr[trealength]++;
  }
  int i = 0;
  int j = 0;
  if (sr[0] == 0) {
    i++;
  }
  if (tr[0] == 0) {
    j++;
  }
  if (i == j) {
    if (srealength <= trealength) {
      out.push_back(make_pair(0, tr[j]));
      sr[i] += tr[j];
      j++;
    } else {
      out.push_back(make_pair(sr[i], 0));
      tr[j] += sr[i];
      i++;
    }
  }
  while ((i < srealength) || (j < trealength)) {
    out.push_back(make_pair(sr[i], tr[j]));
    tr[j + 1] += sr[i];
    sr[i + 1] += tr[j];
    i++;
    j++;
  }
}
void cutl(string s, string t, int num, vector<pair<int, int> > &out) {
  int i = 0;
  while (num > 0) {
    i++;
    if (s[i] != s[i - 1]) {
      num--;
    }
  }
  t = s.substr(0, i) + t;
  s = s.substr(i);
  out.push_back(make_pair(i, 0));
  cruel(s, t, out);
}
void cutlp(string s, string t, int num, vector<pair<int, int> > &out) {
  int i = 0;
  while (num > 0) {
    i++;
    if (s[i] != s[i - 1]) {
      num--;
    }
  }
  int j = 0;
  num = 1;
  while (num > 0) {
    j++;
    if (t[j] != t[j - 1]) {
      num--;
    }
  }
  string tt = s.substr(0, i) + t.substr(j);
  string ss = t.substr(0, j) + s.substr(i);
  out.push_back(make_pair(i, j));
  cruel(ss, tt, out);
}
void cutr(string s, string t, int num, vector<pair<int, int> > &out) {
  int i = 0;
  while (num > 0) {
    i++;
    if (t[i] != t[i - 1]) {
      num--;
    }
  }
  s = t.substr(0, i) + s;
  t = t.substr(i);
  out.push_back(make_pair(0, i));
  cruel(s, t, out);
}
void cutrp(string s, string t, int num, vector<pair<int, int> > &out) {
  int i = 0;
  while (num > 0) {
    i++;
    if (t[i] != t[i - 1]) {
      num--;
    }
  }
  int j = 0;
  num = 1;
  while (num > 0) {
    j++;
    if (s[j] != s[j - 1]) {
      num--;
    }
  }
  string tt = s.substr(0, j) + t.substr(i);
  string ss = t.substr(0, i) + s.substr(j);
  out.push_back(make_pair(j, i));
  cruel(ss, tt, out);
}
int main() {
  ios::sync_with_stdio(false);
  string s;
  cin >> s;
  string t;
  cin >> t;
  int n = s.size() + t.size() + 2;
  vector<int> sr(n);
  int srealength = 0;
  for (int i = 0; i < s.size(); i += 1) {
    if ((s[i] - 'a') % 2 != srealength % 2) {
      srealength++;
    }
    sr[srealength]++;
  }
  vector<int> tr(n);
  int trealength = 0;
  for (int i = 0; i < t.size(); i += 1) {
    if ((t[i] - 'a') % 2 != trealength % 2) {
      trealength++;
    }
    tr[trealength]++;
  }
  vector<pair<int, int> > out;
  cruel(s, t, out);
  if (out.size() == 0) {
    cout << 0 << endl;
    return 0;
  }
  vector<pair<int, int> > outi1;
  vector<pair<int, int> > outi2;
  vector<pair<int, int> > outi3;
  vector<pair<int, int> > outi4;
  vector<pair<int, int> > outi5;
  vector<pair<int, int> > outi6;
  if (srealength >= trealength) {
    int averge = (srealength - trealength) / 2;
    cutl(s, t, averge - 1, outi1);
    cutl(s, t, averge, outi2);
    cutl(s, t, min(averge + 1, srealength - 1), outi3);
    cutlp(s, t, averge, outi4);
    cutlp(s, t, min(averge + 1, srealength - 1), outi5);
    cutlp(s, t, min(averge + 2, srealength - 1), outi6);
  }
  if (srealength + 1 <= trealength) {
    int averge = (trealength - srealength) / 2;
    cutr(s, t, averge - 1, outi1);
    cutr(s, t, averge, outi2);
    cutr(s, t, min(averge + 1, trealength - 1), outi3);
    cutrp(s, t, averge, outi4);
    cutrp(s, t, min(averge + 1, trealength - 1), outi5);
    cutrp(s, t, min(averge + 2, trealength - 1), outi6);
  }
  if (outi1.size() < out.size()) {
    out = outi1;
  }
  if (outi2.size() < out.size()) {
    out = outi2;
  }
  if (outi3.size() < out.size()) {
    out = outi3;
  }
  if (outi4.size() < out.size()) {
    out = outi4;
  }
  if (outi5.size() < out.size()) {
    out = outi5;
  }
  if (outi6.size() < out.size()) {
    out = outi6;
  }
  cout << out.size() << endl;
  for (int i = 0; i < out.size(); i += 1) {
    cout << out[i].first << ' ' << out[i].second << endl;
  }
  return 0;
}