#include using namespace std; int P[] = {20104, 20063, 19892, 20011, 19874, 20199, 19898, 20163, 19956, 19841}; int main() { string S; cin >> S; int N = S.length(); vector p(10); for(int i = 0; i < 10; i++) p[i] = 0; for(int i = 0; i < N; i++) { if(S[i] != '.') p[S[i] - 0x30]++; } int a, b; for(int i = 0; i < 10; i++) { if(P[i] > p[i]) b = i; if(P[i] < p[i]) a = i; } cout << a << " " << b << endl; return 0; }