#include #include #include #include int main() { enum SUCCESS { NONE, YES, NO, }; int turn = 0; int nums[10] = { 0 }; int isExist = false; int ans = 0; scanf("%d", &turn); for (int i = 0;i < turn;i++) { char str[10] = ""; int num[4] = {0}; for (int j = 0;j < 4;j++) { scanf("%d", &num[i]); } scanf("%s", str); if (str == "YES") { for (int j = 0;j < 4;j++) { nums[num[j]]++; } } else { for (int j = 0;j < 4;j++) { nums[num[j]]--; } } } for (int i = 0;i < 10;i++) { int tmp = nums[i]; if (nums[tmp] > nums[ans]) { ans = tmp; } } printf("%d\n",ans); return 0; }