#include #include int main(void) { int i, j, n, max, pos; int d[4], yes[10], no[10]; char b[4]; scanf("%d", &n); for (i = 0; i < n; i++) { for (j = 0; j < 4; j++) scanf("%d", &d[j]); scanf("%s", b); if (strcmp(b, "YES") == 0) for (j = 0; j < 4; j++) yes[d[j]]++; else for (j = 0; j < 4; j++) no[d[j]]++; } for (i = 0; i < 10; i++) if (no[i] > 0) yes[i] =0; max = 0; for (i = 0; i < 10; i++) if (max < yes[i]) { max = yes[i]; pos = i; } printf("%d\n", pos); return 0; }