#include "bits/stdc++.h" #define rep(i,n) for(int i=0;i> S; while (true) { if (S.substr(0, 2) != "AC") { cout << "Failed..." << endl; return 0; } S = S.substr(2); if (S.size() == 0) { cout << "Done!" << endl; return 0; } if (S[0] != ',') { cout << "Failed..." << endl; return 0; } S = S.substr(1); } }