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