#include <bits/stdc++.h>
using namespace std;
int main() {
  long long a;
  cin >> a;
  if (a % 4 == 0) {
    cout << 1 << " A";
  } else if (a % 4 == 1) {
    cout << 0 << " A";
  } else if (a % 4 == 2) {
    cout << 1 << " B";
  } else if (a % 4 == 3)
    cout << 2 << " A";
  return 0;
}
