#include <bits/stdc++.h>
using namespace std;
char category[4] = {'D', 'A', 'C', 'B'};
int main() {
  int x;
  cin >> x;
  if (category[x % 4] == 'A') {
    cout << 0 << " " << category[x % 4];
  } else if (category[x % 4] == 'B') {
    cout << 2 << " " << category[(x + 2) % 4];
  } else if (category[x % 4] == 'C') {
    cout << 1 << " " << category[(x + 1) % 4];
  } else {
    cout << 1 << " " << category[(x + 1) % 4];
  }
}
