#include #include #include #include using namespace std; int a[10] = { 1954, 1997, 1986, 1987, 2043, 2082, 2017, 1953, 1962, 2020 }; int b[10]; int main() { char cc; for (int i = 0; i < 20002; i++) { cc = getchar(); if(cc != '.') b[cc - '0']++; } int g = 0; int l = 0; for (int i = 0; i < 10; i++) { //cout << a[i] << " - " << b[i] << endl; if (a[i] < b[i]) { l = i; } if (a[i] > b[i]) { g = i; } } cout << l << " " << g << endl; return 0; }