#include using namespace std; int main() { ios_base::sync_with_stdio(0); cin.tie(0); vector hist { 20104,20063, 19892, 20011, 19874, 20199, 19898, 20163, 19956, 19841}; string s; cin >> s; for (char c: s) if (isdigit(c)) --hist[c - '0']; int x, y; for (int i = 0; i < 10; i++) { if (hist[i] < 0) x = i; if (hist[i] > 0) y = i; } cout << x << " " << y << endl; return 0; }