#include <bits/stdc++.h>
using namespace std;
template <class T>
void read(T &u) {
  u = 0;
  char c = getchar();
  long long flag = 0;
  while (c < '0' || c > '9') flag |= (c == '-'), c = getchar();
  while (c >= '0' && c <= '9')
    u = (u << 3) + (u << 1) + (c ^ 48), c = getchar();
  if (flag) u = -u;
}
template <class T>
void write(T u) {
  if (u < 0) printf("-"), u = -u;
  if (u < 10)
    putchar(48 + u);
  else
    write(u / 10), putchar(48 + u % 10);
}
template <class T, class... Arg>
void read(T &u, Arg &...v) {
  read(u);
  read(v...);
}
template <class T>
void write(T u, char c) {
  write(u);
  putchar(c);
}
template <class T>
bool checkmin(T &a, T b) {
  return (b < a ? a = b, 1 : 0);
}
template <class T>
bool checkmax(T &a, T b) {
  return (b > a ? a = b, 1 : 0);
}
template <class T>
T _min(T a, T b) {
  return (a < b ? a : b);
}
template <class T>
T _max(T a, T b) {
  return (a > b ? a : b);
}
long long x, y;
vector<long long> v;
long long gcd(long long a, long long b) {
  if (!b) {
    return a;
  }
  long long g = gcd(b, a % b);
  if (b == 1)
    v.push_back(a / b - 1);
  else
    v.push_back(a / b);
  return g;
}
void init() { read(x, y); }
void solve() {
  if (gcd(x, y) != 1) {
    printf("Impossible\n");
    return;
  }
  reverse(v.begin(), v.end());
  char now = 'A';
  for (long long i = 0; i < (long long)v.size(); ++i) {
    if (v[i]) printf("%lld%c", v[i], now);
    if (now == 'A')
      now++;
    else
      now--;
  }
  printf("\n");
}
int main() {
  int T = 1;
  while (T--) {
    init();
    solve();
  }
  return 0;
}
