#include #include #include #include #include #include #include #define MAX_N 10 bool bool_table[MAX_N]; int point_table[MAX_N]; int main(){ int n; int* a; int* b; int* c; int* d; std::cin >> n; a =(int*)malloc(sizeof(int)*n); b =(int*)malloc(sizeof(int)*n); c =(int*)malloc(sizeof(int)*n); d =(int*)malloc(sizeof(int)*n); std::vector r; std::string str; for(register int i = 0; i < n; i++){ std::cin >> a[i] >> b[i] >> c[i] >> d[i] >> str; r.push_back(str); } for(register int i =0; i < MAX_N; i++){ bool_table[i] = true; point_table[i] = 0; } //init for(register int i = 0; i < n; i++){ if(r[i] == "NO"){ bool_table[a[i]] = false; bool_table[b[i]] = false; bool_table[c[i]] = false; bool_table[d[i]] = false; } else{ point_table[a[i]]++; point_table[b[i]]++; point_table[c[i]]++; point_table[d[i]]++; } } int tmp = -1; for(register int i =0; i < MAX_N; i++){ if(bool_table[i] == true){ if(point_table[i] > tmp){ tmp = i; } } } if(tmp == -1){ for(register int i=0; i