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