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;
char a[2000005], b[2000005];
int lena, lenb, bega, begb, num[2000005], tot, siza, sizb, nex[2000005],
    las[2000005], col[2000005], ans, A[2000005], B[2000005];
int main() {
  scanf("%s", a + 1);
  scanf("%s", b + 1);
  lena = strlen(a + 1);
  lenb = strlen(b + 1);
  int now = 1, last = 1;
  bega = 1;
  while (last <= lena) {
    siza++;
    tot++;
    col[tot] = a[last] - 'a' + 1;
    while (a[now] == a[last]) {
      num[tot]++;
      now++;
    }
    last = now;
  }
  for (int i = 1; i < tot; i++) nex[i] = i + 1;
  for (int i = 2; i <= tot; i++) las[i] = i - 1;
  begb = tot + 1;
  now = last = 1;
  while (last <= lenb) {
    sizb++;
    tot++;
    col[tot] = b[last] - 'a' + 1;
    while (b[now] == b[last]) {
      num[tot]++;
      now++;
    }
    last = now;
  }
  for (int i = begb; i < tot; i++) nex[i] = i + 1;
  for (int i = begb + 1; i <= tot; i++) las[i] = i - 1;
  if (siza == 1 && col[bega] == col[begb] && sizb % 4 == 2) {
    ans++;
    int nw = begb;
    for (int i = 1; i <= sizb / 2; i++, nw = nex[nw]) {
      B[ans] += num[nw];
    }
    num[las[nw]] += num[bega];
    bega = begb;
    nex[las[nw]] = 0;
    begb = nw;
    las[nw] = 0;
    siza = sizb = sizb / 2;
  } else if (sizb == 1 && col[bega] == col[begb] && siza % 4 == 2) {
    ans++;
    int nw = bega;
    for (int i = 1; i <= siza / 2; i++, nw = nex[nw]) {
      A[ans] += num[nw];
    }
    num[las[nw]] += num[begb];
    begb = bega;
    nex[las[nw]] = 0;
    bega = nw;
    las[nw] = 0;
    siza = sizb = sizb / 2;
  }
  while (col[bega] == col[begb]) {
    if (siza == 1 && sizb == 1) break;
    if (siza > sizb) {
      if (siza == 2 && sizb == 1) {
        ans++;
        A[ans] = num[bega];
        B[ans] = 0;
        break;
      } else {
        siza = max(1, siza - 2);
        sizb = max(2, sizb);
        int a1 = bega, a2 = nex[a1], a3 = nex[a2];
        int b1 = begb, b2 = nex[b1];
        ans++;
        A[ans] = num[a1] + num[a2];
        B[ans] = num[b1];
        begb = a1;
        bega = b1;
        nex[a2] = nex[b2];
        num[a2] += num[b2];
        if (nex[a2]) las[nex[a2]] = a2;
        nex[b1] = nex[a3];
        num[b1] += num[a3];
        if (nex[b1]) las[nex[b1]] = b1;
      }
    } else {
      if (sizb == 2 && siza == 1) {
        ans++;
        B[ans] = num[begb];
        A[ans] = 0;
        break;
      } else {
        sizb = max(1, sizb - 2);
        siza = max(2, siza);
        int a1 = bega, a2 = nex[a1];
        int b1 = begb, b2 = nex[b1], b3 = nex[b2];
        ans++;
        A[ans] = num[a1];
        B[ans] = num[b1] + num[b2];
        begb = a1;
        bega = b1;
        nex[b2] = nex[a2];
        num[b2] += num[a2];
        if (nex[b2]) las[nex[b2]] = b2;
        nex[a1] = nex[b3];
        num[a1] += num[b3];
        if (nex[a1]) las[nex[a1]] = a1;
      }
    }
  }
  while (col[bega] != col[begb]) {
    if (siza == 1 && sizb == 1) break;
    if (siza > sizb) {
      if (siza - 3 >= sizb) {
        siza -= 3;
        sizb = max(sizb + 1, 3);
        int a1 = bega, a2 = nex[a1], a3 = nex[a2], a4 = nex[a3];
        int b1 = begb, b2 = nex[b1];
        ans++;
        A[ans] = num[a1] + num[a2] + num[a3];
        B[ans] = num[b1];
        begb = a1;
        bega = b1;
        nex[a3] = nex[b2];
        num[a3] += num[b2];
        if (nex[a3]) las[nex[a3]] = a3;
        nex[b1] = nex[a4];
        num[b1] += num[a4];
        if (nex[b1]) las[nex[b1]] = b1;
      } else {
        siza = max(1, siza - 1);
        sizb = max(1, sizb - 1);
        int a1 = bega, a2 = nex[a1];
        int b1 = begb, b2 = nex[b1];
        bega = b1;
        begb = a1;
        ans++;
        A[ans] = num[a1];
        B[ans] = num[b1];
        nex[a1] = nex[b2];
        num[a1] += num[b2];
        if (nex[a1]) las[nex[a1]] = a1;
        nex[b1] = nex[a2];
        num[b1] += num[a2];
        if (nex[b1]) las[nex[b1]] = b1;
      }
    } else {
      if (sizb - 3 >= siza) {
        sizb -= 3;
        siza = max(siza + 1, 3);
        int a1 = bega, a2 = nex[a1];
        int b1 = begb, b2 = nex[b1], b3 = nex[b2], b4 = nex[b3];
        ans++;
        A[ans] = num[a1];
        B[ans] = num[b1] + num[b2] + num[b3];
        begb = a1;
        bega = b1;
        nex[a1] = nex[b4];
        num[a1] += num[b4];
        if (nex[a1]) las[nex[a1]] = a1;
        nex[b3] = nex[a2];
        num[b3] += num[a2];
        if (nex[b3]) las[nex[b1]] = b3;
      } else {
        siza = max(1, siza - 1);
        sizb = max(1, sizb - 1);
        ans++;
        int a1 = bega, a2 = nex[a1];
        int b1 = begb, b2 = nex[b1];
        A[ans] = num[a1];
        B[ans] = num[b1];
        bega = b1;
        begb = a1;
        nex[a1] = nex[b2];
        num[a1] += num[b2];
        if (nex[a1]) las[nex[a1]] = a1;
        nex[b1] = nex[a2];
        num[b1] += num[a2];
        if (nex[b1]) las[nex[b1]] = b1;
      }
    }
  }
  printf("%d\n", ans);
  for (int i = 1; i <= ans; i++) {
    printf("%d %d\n", A[i], B[i]);
  }
}