#include <bits/stdc++.h>
using namespace std;
char phanloai(int x) {
  char t;
  if (x == 1) t = 'A';
  if (x == 3) t = 'B';
  if (x == 2) t = 'C';
  if (x == 0) t = 'D';
  return t;
}
int main() {
  int a;
  cin >> a;
  int t = a % 4, c, d;
  c = (t + 1) % 4;
  d = (t + 2) % 4;
  char x, y, z;
  x = phanloai(t);
  y = phanloai(c);
  z = phanloai(d);
  if (x < y && x < z) cout << 0 << " " << x;
  if (y < x && y < z) cout << 1 << " " << y;
  if (z < x && z < y) cout << 2 << " " << z;
  return 0;
}
