#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; #define lint long long int /* vectoral(26); al = {'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'}; vectorAL(26); AL = {'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'}; */ int main() { int N; cin >> N; if (N == 1) { string A; cin >> A; cout << A.size() - 2 << endl; } else { vectorvecs(N); for (int i = 0; i < N; i++) { cin >> vecs.at(i); } vectorveci(N); for (int i = 0; i < N; i++) { veci.at(i) = vecs.at(i).size() - 2; } sort(veci.begin(), veci.end()); int ans = 0; int cnt = 0; for (int i = 0; i < N - 1; i++) { if (veci.at(i) == veci.at(i + 1)) { cnt++; } else { ans = max(ans, cnt); cnt = 0; } } reverse(veci.begin(), veci.end()); int ansa = 0; int cnta = 0; for (int i = 0; i < N; i++) { if (veci.at(i) == veci.at(i + 1)) { cnta++; } if (veci.at(i) != veci.at(i + 1)) { cnta = 0; } if (cnta == ans) { cout << veci.at(i) << endl; break; } } } }