#include <bits/stdc++.h>
using namespace std;
int x;
int main() {
  cin >> x;
  if (x % 4 == 0) cout << "1 A";
  if (x % 4 == 1) cout << "0 A";
  if (x % 4 == 2) cout << "1 B";
  if (x % 4 == 3) cout << "2 A";
  return 0;
}
