import sys input = sys.stdin.readline a=float(input()) a*=1000 a=int(a) ANS=0 x=0 y=0 up=0 while True: #print(x,y,up) if up==0: y^=1 x+=a ANS+=2 if x>1000: q=x//1000 r=x%1000 up^=(q%2) if up==1: x=1000-r else: x=r ANS+=q else: y^=1 x-=a ANS+=2 if x<0: q=x//1000 r=x%1000 up^=(q%2) if up==1: x=r else: x=1000-r ANS+=abs(q) if x==0: if y==0: print("A",ANS-1) break else: print("B",ANS-2) break elif x==1000: if y==0: print("C",ANS-2) break else: print("A",ANS-1) break