#include #include #include #include #include #include #include #include #include #include //#include #include #include #include //#include #include #include //#include #include #include #include #include const int dx[] = {1, 0, -1, 0}; const int dy[] = {0, 1, 0, -1}; using namespace std; typedef long long ll; typedef vector vi; typedef vector vll; typedef pair pii; int num[10] = {20104,20063,19892,20011,19874,20199,19898,20163,19956,19841}; int main() { string s; cin >> s; vector cnt(10); for (char c : s) { if (isdigit(c)) { cnt[c-'0']++; } } int ans0, ans1; for (int i = 0; i < 10; i++) { if (cnt[i] < num[i]) ans0 = i; if (cnt[i] > num[i]) ans1 = i; } cout << ans0 << " " << ans1 << endl; return 0; }