#include #include int main(int argc, char *argv[]){ int n, a, b, c, d; char s[3]; int x[10] = {}; scanf("%d", &n); for (int i = 0; i < n; i++) { scanf("%d%d%d%d%s", &a, &b, &c, &d, s); if (strcmp(s, "YES") == 0) { 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++) { // printf("%d%s%d\n", i, ":", x[i]); if (x[r] < x[i]) { r = i; } } printf("%d\n", r); return 0; }