#include <bits/stdc++.h>
const int D = 100;
using namespace std;
int main() {
  int n, r;
  cin >> n >> r;
  int min = n;
  long long f1 = 1;
  long long f2 = 1;
  for (int i = 0; i < n - 1 && f2 < r; i++) {
    f1 = f2 + f1;
    swap(f1, f2);
  }
  if (r > f2) {
    cout << "IMPOSSIBLE" << endl;
    return 0;
  }
  int *res = new int[n];
  int size = -1;
  if (n == r && n == 1) {
    cout << 0 << endl << "T" << endl;
    return 0;
  }
  if (n == r && n == 2) {
    cout << 0 << endl << "TB" << endl;
    return 0;
  }
  int *p = new int[n];
  for (int i = r / 2; i >= 1; i--) {
    int num = 1;
    p[0] = 1;
    int a = r - i;
    int b = i;
    int k = 1;
    int err = 0;
    while (a + b > 2 && a * b != 0) {
      if (b == 1) {
        k += a - 1;
        err += a - 2;
        p[num++] = a - 1;
        a = 1;
        b = 0;
        break;
      }
      int c = a / b;
      k += c;
      if (k > n - 1) break;
      err += c - 1;
      if (err >= min) break;
      p[num++] = c;
      a = a % b;
      swap(a, b);
    }
    if (a == 1 && b == 0 && err < min && k == n - 1) {
      for (int j = 0; j < num; j++) res[j] = p[j];
      size = num;
      min = err;
      if (err == 0) break;
    }
  }
  if (min < n) {
    cout << min << endl;
    cout << "T";
    bool e = false;
    for (int i = size - 1; i >= 0; i--) {
      for (int j = 0; j < res[i]; j++) cout << ((e) ? 'T' : 'B');
      e = !e;
    }
    cout << endl;
  } else
    cout << "IMPOSSIBLE" << endl;
  return 0;
}
