#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  char c[4] = {'D', 'A', 'C', 'B'};
  long long int n, n1, n2;
  cin >> n;
  if (n % 4 == 1)
    cout << 0 << " A\n";
  else {
    n1 = (n + 1) % 4;
    n2 = (n + 2) % 4;
    if (n1 == 1)
      cout << 1 << " A" << endl;
    else if (n2 == 1)
      cout << 2 << " A" << endl;
    else if (n1 == 3)
      cout << 1 << " B" << endl;
    else if (n2 == 3)
      cout << 2 << " B" << endl;
    else if (n1 == 2)
      cout << 1 << " C" << endl;
    else if (n2 == 2)
      cout << 2 << " C" << endl;
    else if (n1 == 0)
      cout << 1 << " D" << endl;
    else if (n2 == 0)
      cout << 2 << " D" << endl;
  }
  return 0;
}
