s=list(input()) a = s.count("A") b = s.count("C") c = s.count(",") if s == a+b+c: print("Done!") else: print("Failed...")