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