#include "bits/stdc++.h"
using namespace std;
#define intt long long
#define fi first
#define se second
const intt mxN = 1e5 + 5;
const intt LG = 20;
const intt inf = 1e18;
string S;
intt p,k,h,t;
set<string> st;
void _() {
cin >> S;
string cur = "";
char c;
for(intt i = 0; i < S.size(); i++) {
cur += S[i];
if((i + 1) % 3 == 0) {
if(st.empty()) st.insert(cur);
else {
if(st.find(cur) != st.end()) {
cout << "GRESKA" << endl;
return;
}
st.insert(cur);
}
cur = "";
}
c = S[i];
if(c == 'P') p++;
if(c == 'K') k++;
if(c == 'H') h++;
if(c == 'T') t++;
}
cout << 13 - p << " " << 13 - k << " " << 13 - h << " " << 13 - t << endl;
}
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
intt t = 1, buu = 1;
// cin >> t;
while(t--){
// cout << "Case #" << buu++ << ": ";
_();
}
}
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |