#include #include #include #include #include #include #include #include #include #include #include #include using namespace std; int main() { int N; string S[105][105]; cin >> N; for (int i = 0; i < N; i++) { for(int j = 0; j> S[i][j]; } } map m; int M = -1; for (int j = 0; j::iterator it = m.begin(); while (it != m.end()) { if ((*it).second == M) { if (flag) { cout << -1 << endl; return 0; } else { ans = (*it).first + 1; flag = true; } } it++; } cout << ans << endl; return 0; }