#include int main(void){ int y[10] = {20104, 20063, 19892, 20011, 19874, 20199, 19898, 20163, 19956, 19841}, b, a; std::string s; std::cin >> s; int l = s.size(); for(int i = 0; i < l; i++){ if(s[i] != '.') y[(int)(s[i] - '0')]--; } for(int i = 0; i < 10; i++){ if(y[i] == 1) b = i; if(y[i] == -1) a = i; } std::cout << a << " " << b << std::endl; return 0; }