#include <bits/stdc++.h>
using namespace std;
int main() {
  int i, j, r, n, x;
  cin >> x;
  r = x % 4;
  if (r == 0) {
    cout << "1"
         << " A";
  }
  if (r == 1) {
    cout << "0"
         << " A";
  }
  if (r == 2) {
    cout << "1"
         << " B";
  }
  if (r == 3) {
    cout << "2"
         << " A";
  }
  return 0;
}
