#include #include #include using namespace std; int main() { int n; cin >> n; map no{{1, 0}, {2, 0}, {3, 0}, {4, 0}, {5, 0}, {6, 0}, {7, 0}, {8, 0}, {9, 0}}; map yes{{1, 0}, {2, 0}, {3, 0}, {4, 0}, {5, 0}, {6, 0}, {7, 0}, {8, 0}, {9, 0}}; for (int i=0; i> a >> b >> c >> d >> s; if (s=="NO") { no[a]++; no[b]++; no[c]++; no[d]++; } else { yes[a]++; yes[b]++; yes[c]++; yes[d]++; } } map mp; for (auto itr=no.begin(); itr!=no.end(); itr++) { if (itr->second==0) { mp[itr->first]++; } } for (auto itr=yes.begin(); itr!=yes.end(); itr++) { if (itr->second>1) { mp[itr->first]++; } } int mx=0; for (auto itr=mp.begin(); itr!=mp.end(); itr++) { if (itr->second>mx) mx=itr->second; } for (auto itr=mp.begin(); itr!=mp.end(); itr++) { if (itr->second==mx) cout << itr->first << endl; } return 0; }