#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, i = 0;
  char k, max = 'Z';
  cin >> n;
  for (int j = 0; j <= 2; j++) {
    if (n % 4 == 1) {
      k = 'A';
    } else if (n % 4 == 3) {
      k = 'B';
    } else if (n % 4 == 2) {
      k = 'C';
    } else {
      k = 'D';
    }
    if (k < max) {
      max = k;
      i = j;
    }
    n++;
  }
  cout << i << " " << max << endl;
  return 0;
}
