#include <bits/stdc++.h>
using namespace std;
void solve(int test_number);
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  cout.setf(ios::fixed);
  cout.precision(9);
  cerr.setf(ios::fixed);
  cerr.precision(3);
  int n = 1;
  for (int i = 0; i < n; i++) {
    solve(i + 1);
  }
  return 0;
}
vector<long long> res1;
vector<char> res2;
int cur = 0;
inline long long gcd(long long a, long long b) {
  if (b == 0) {
    return a;
  } else {
    res1.push_back(a / b);
    res2.push_back(cur + 'A');
    cur = 1 - cur;
    return gcd(b, a % b);
  }
}
void solve(int test_number) {
  long long a, b;
  cin >> a >> b;
  if (a < b) {
    cur = 1;
    swap(a, b);
  }
  if (gcd(a, b) != 1) {
    cout << "Impossible" << endl;
  } else {
    res1[res1.size() - 1]--;
    for (int i = 0; i < (int)res1.size(); i++) {
      cout << res1[i] << res2[i];
    }
    cout << endl;
  }
}
