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) if up==0: y^=1 x+=a ANS+=2 if x>1000: up^=1 x=1000-(x-1000) ANS+=1 else: y^=1 x-=a ANS+=2 if x<0: up^=1 x=-x ANS+=1 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