#include <bits/stdc++.h>
using namespace std;
const int rem[] = {0, 3, 1, 2};
const char req[] = {'D', 'A', 'C', 'B'};
int main() {
  int x;
  cin >> x;
  int r = x;
  int id = 0;
  for (int k = 1; k <= 2; ++k) {
    if (rem[(x + k) % 4] > rem[r % 4]) {
      r = x + k;
      id = k;
    }
  }
  cout << id << ' ' << req[r % 4];
}
