#pragma GCC optimize("Ofast") #pragma GCC target("avx2") #pragma GCC optimize("O3") #pragma GCC optimize("unroll-loops") #include #include #include #include #include #include #include #include #define se second #define fi first using namespace std; using ll = long long; using ull = unsigned long long; #define rep(i,n) for(long long i = 0; i < (int)n; i++) #define FOR(i, m, n) for(long long i = (m);i < (n); ++i) #define RFOR(i, n, m) for(long long i = (m-1);i >= (n); --i) #define ALL(obj) (obj).begin(),(obj).end() #define SPEED cin.tie(0);ios::sync_with_stdio(false); template using V = vector; template using P = pair; template using PQ = priority_queue; template using PQR = priority_queue,greater>; void print(V ar) { for(auto x: ar)cout << x << " " ; cout << endl; } ll gcd(ll a, ll b) { if (a0) { if (n%2) { r*=x; r%=p; } x *= x; x %= p; n/=2; } return r; } const ll mod = 998244353; V> facts(ll n) { V> res; if (n==1)return res; for(int x = 2; x*x<=n; x++) { if (n%x==0) { int p = 0; while (n%x==0) { p+=1; n/=x; } res.emplace_back(P(x, p)); } } if (n!=1) { res.emplace_back(P(n, 1)); } return res; } const int inf = 1000000000; int main() { string n;cin >> n; V a(8,0); rep(i, n.size()) { if (n[i]=='A') { a[1]+=1; a[2]+=1; } else if(n[i]=='B') { a[1]+=1; a[3]+=1; } else if(n[i]=='C') { a[1] += 1; a[4]+=1; } else if(n[i]=='D') { a[1]++; a[5]++; } else if(n[i]=='E') { a[1]++; a[6]++; } else { a[1]++; a[7]++; } } int m = *max_element(a.begin(),a.end()); //cout << m << endl; V ans; rep(i, 8) { if (a[i]==m) { ans.emplace_back(i); } } rep(i, ans.size()-1) { cout << ans[i] << " "; } cout << ans[ans.size()-1] << endl; }