#include <bits/stdc++.h>
using namespace std;
void fast() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
}
int main() {
  fast();
  long long n;
  cin >> n;
  if (n % 4 == 1)
    cout << '0' << " " << 'A' << endl;
  else if (n % 4 == 0)
    cout << '1' << " " << 'A' << endl;
  else if (n % 4 == 2)
    cout << '1' << " " << 'B' << endl;
  else if (n % 4 == 3)
    cout << '2' << " " << 'A' << endl;
  return 0;
}
