S = [i for i in input().rstrip().split(",")] if len(set(S)) == 1 and "AC" in S: print("Done!") else: print("Failed...")