#include <bits/stdc++.h>
using namespace std;
const int L = 1000000 + 10;
long long x, y;
vector<long long> ans;
long long gcd(long long x, long long y) {
  long long z;
  while (x != y) {
    if (x < y) {
      if (x == 0) return y;
      z = y / x - (x == 1);
      ans.push_back(z);
      y -= z * x;
    } else {
      if (y == 0) return x;
      z = x / y - (y == 1);
      ans.push_back(z);
      x -= z * y;
    }
  }
  return x;
}
int main() {
  scanf("%I64d %I64d", &x, &y);
  ans.clear();
  if (gcd(x, y) == 1) {
    char flag;
    if (x < y)
      flag = 1;
    else
      flag = 0;
    for (int i = 0; i < ans.size(); i++, flag ^= 1)
      printf("%I64d%c", ans[i], flag + 'A');
    putchar('\n');
  } else
    puts("Impossible");
  return 0;
}
