#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 5;
const long long Mod = 1e9 + 7;
long long powmod(long long a, long long b) {
  long long res = 1;
  a %= Mod;
  assert(b >= 0);
  for (; b; b >>= 1) {
    if (b & 1) res = res * a % Mod;
    a = a * a % Mod;
  }
  return res;
}
long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
int x, res;
char resc;
int main() {
  scanf("%d", &x);
  resc = 'A';
  switch (x % 4) {
    case 0:
      res = 1;
      break;
    case 1:
      res = 0;
      break;
    case 2:
      res = 1;
      resc = 'B';
      break;
    case 3:
      res = 2;
      break;
  }
  printf("%d %c\n", res, resc);
  return 0;
}
