import std; void main(){ auto a = readln.chomp.split(".").join.to!long; ulong x = 0; ulong y = 0; ulong result = 0; auto d = 0; while(true){ d += a; if(d > 1000 && (x + y) % 2 == 1){ d -= 1000; y += 1; result += 1; } while(d > 1000){ d -= 1000; y += 1; result += 2; } if(d == 1000){ char c = 'A'; if((x + y) % 2 == 0){ result += 1; }else{ if(x % 2 == 0){ c = 'B'; }else{ c = 'C'; } } writefln("%c %d", c, result); break; } if((x + y) % 2 == 0 || d - a > 0){ result += 1; } result += 1; x += 1; } }