#include #include using namespace std; int main(){ int x[10] = {20104,20063,19892,20011,19874,20199,19898,20163,19956,19841}; string s;cin>>s; vector A(11); for(int i = 0; s.size() > i; i++){ if(s[i] == '.')continue; A[s[i]-'0']++; } pair ans; for(int i = 0; 10 > i; i++){ if(x[i]-A[i] == -1)ans.first = i; if(x[i]-A[i] == 1)ans.second = i; } cout << ans.first << " " << ans.second << endl; }