#define _USE_MATH_DEFINES #include //cin, cout #include //vector #include //sort,min,max,count #include //string,getline, to_string #include //abs(int) #include //swap, pair #include //tuple #include //deque #include //INT_MAX #include //bitset #include //sqrt, ceil. M_PI, pow, sin #include //fixed #include //setprecision #include //stringstream #include //gcd, assumlate #include //randam_device #include //numeric_limits #include using namespace std; constexpr long long int D_MOD = 1000000007; int main() { string N; cin >> N; string nx, temp; for (unsigned int i = 0; i < N.size(); i++) { switch (N.at(i)) { case 'A':temp = "1010"; break; case 'B':temp = "1011"; break; case 'C':temp = "1100"; break; case 'D':temp = "1101"; break; case 'E':temp = "1110"; break; case 'F':temp = "1111"; break; } nx += temp; } string num, ans; int a = 0; while (!nx.empty()) { for (int i = 0; i < 3; i++) { num.push_back(nx.back()); nx.pop_back(); if (nx.empty()) { break; } } for (unsigned int i = 0; i < num.size(); i++) { a += (num.at(i) - '0') * pow(2, i); } ans += to_string(a); num.clear(); a = 0; } vector C(8, 0); for (unsigned int i = 0; i < ans.size(); i++) { C.at(ans.at(i) - '0')++; } int max = *std::max_element(C.begin(), C.end()); for (int i = 0; i < 8; i++) { if (C.at(i) == max) { cout << i << " "; } } cout << endl; return 0; }