using System; using System.Collections.Generic; using static System.Console; using System.Linq; class yuki { static int NN => int.Parse(ReadLine()); static int[] NList => ReadLine().Split().Select(int.Parse).ToArray(); static void Main() { var a = int.Parse(ReadLine().Replace(".", "")); var p = 1000; var gcd = GCD(a, p); var x = p / gcd; var y = a / gcd; var pt = (x + y) % 2 == 0 ? "A" : x % 2 == 1 ? "B" : "C"; WriteLine(pt + " " + (x - 1 + y - 1 + (x + y) / 2 + Math.Abs(x - y) / 2)); } static int GCD(int a, int b) { if (a < b) return GCD(b, a); if (a % b == 0) return b; return GCD(b, a % b); } }