r=gets.to_r x,y=r.denominator,r.numerator $><<[%w[A B C][x%2-y%2],x+y-2+(x+y)/2+(x-y).abs/2]*' '