#include <bits/stdc++.h>
using namespace std;
template <class T1, class T2>
ostream& operator<<(ostream& out, pair<T1, T2> p);
template <template <class...> class _TContainer, class... _T>
ostream& operator<<(ostream& out, _TContainer<_T...>& _Container);
int main() {
  int x;
  cin >> x;
  if (x % 4 == 0) {
    cout << 1 << " " << 'A';
    return 0;
  }
  if (x % 4 == 1) {
    cout << 0 << " " << 'A';
    return 0;
  }
  if (x % 4 == 2) {
    cout << 1 << " " << 'B';
    return 0;
  }
  if (x % 4 == 3) {
    cout << 2 << " " << 'A';
    return 0;
  }
  return 0;
}
static auto _batch_ios = []() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  return 42;
}();
template <class T1, class T2>
ostream& operator<<(ostream& out, pair<T1, T2> p) {
  return out << '(' << p.first << ',' << p.second << ')';
}
template <template <class...> class _TContainer, class... _T>
ostream& operator<<(ostream& out, _TContainer<_T...>& _Container) {
  out << '[';
  bool first = 1;
  for (auto x : _Container) {
    if (!first) out << ',';
    out << x;
    first = 0;
  }
  out << ']';
  return out;
}
