S=str(input()) print("Done!" if S.count("AC")-1==S.count(",") else "Failed...")