S=list(input().split(",")) x=len(S) a=0 for i in range(0,x): if S[i-1]=="AC": a=a+1 if a==x: print("Done!") else: print("Failed...")