S = eval(input())



dict = {'ABC': 'ARC', 'ARC':'ABC'}

print((dict[S]))
dict = {'ABC':'ARC', 'ARC':'ABC'}



print((dict[eval(input())]))
S = eval(input())
dict = {"ABC": "ARC", "ARC": "ABC"}
print((dict[S]))

dict = {"ABC": "ARC", "ARC": "ABC"}
print((dict[eval(input())]))

-S = eval(input()) -print((dict[S])) +print((dict[eval(input())]))