main = do
  s <- getLine
  putStr $ solve s

solve s = convert s ["ABC","ARC"]

convert n [a,b]
 | n == a = b
 | n == b = a
 | otherwise = "Error: the input " ++ n ++ " is neither " ++ a ++ " nor " ++ b ++ "."
