#include using namespace std; int main(){ ios::sync_with_stdio(false); cin.tie(0); vector a = {20104,20063,19892,20011,19874,20199,19898,20163,19956,19841}; string s; cin >> s; int f, t; for(int i = 0; i < 10; i++){ if(count(s.begin(), s.end(), '0' + i) < a[i]) f = i; if(count(s.begin(), s.end(), '0' + i) > a[i]) t = i; } cout << t << ' ' << f << '\n'; }