#include #include using namespace std; int main() { int n, a, b, c, d; char s[3]; int x[10] = {}; cin >> n; for (int i = 0; i < n; i++) { cin >> a >> b >> c >> d >> s; if (s == "YES") { x[a]++; x[b]++; x[c]++; x[d]++; } else { x[a]--; x[b]--; x[c]--; x[d]--; } } int r = 0; for (int i = 1; i < 10; i++) { if (x[r] < x[i]) { r = i; } } cout << r << endl; return 0; }