#include int main() { char s; int cnt[10] = {}, b, a, i; const int pi[10] = { 20104,20063,19892,20011,19874,20199,19898,20163,19956,19841 }; for (i = 0; i < 200002; i++) { s = getchar(); if (i != 1) cnt[s - '0']++; } for (i = 0; i < 10; i++) { if (cnt[i] > pi[i]) b = i; else if (cnt[i] < pi[i]) a = i; } printf("%d %d\n", b, a); return 0; }