// yukicoder: No.313 π // 2019.6.20 bal4u #include #if 1 #define gc() getchar_unlocked() #define pc(c) putchar_unlocked(c) #else #define gc() getchar() #define pc(c) putchar(c) #endif int ans[10] = { 20104, 20063, 19892, 20010, 19874, 20199, 19898, 20163, 19956, 19841 }; int f[10]; int main() { int n, c, a, b; if ((c = gc()) != '3') { pc(c), puts(" 3"); return 0; } gc(); // skip '.' n = 200000; while (n--) { do c = gc(); while (c < '0'); f[c & 0xf]++; } #if 0 // get answer for (c = 0; c < 10; c++) printf("%d, ", f[c]); printf("\n"); #else for (c = 0; c < 10; c++) { if (f[c] < ans[c]) b = c; else if (f[c] > ans[c]) a = c; } pc('0'+a), pc(' '), pc('0'+b), pc('\n'); #endif return 0; }