class Answer { constructor(input) { this.S = input; } main() { let a = this.S.match(/AC/g); if(a) { let b = 'AC,'.repeat(a.length).slice(0, -1); let ans = (this.S == b) ? 'Done!' : 'Failed...' ; this.dest(ans); }else { this.dest('Failed...'); } } dest(ans) { console.log(ans); } } new Answer(require('fs').readFileSync('/dev/stdin', 'utf8')).main();