#include <bits/stdc++.h>
using namespace std;
const int maxn = 1000010;
long long a[maxn], sums[maxn];
int main() {
  ios::sync_with_stdio(false);
  int x, sum = 0;
  cin >> x;
  if (x % 4 == 2) {
    cout << 1 << " B";
  } else if (x % 4 == 3) {
    cout << 2 << " A";
  } else if (x % 4 == 0) {
    cout << 1 << " A";
  } else if (x % 4 == 1) {
    cout << 0 << " A";
  }
}
