use strict; use warnings; my $n = <>; my @ans = (0, 0, 0, 0, 0, 0, 0, 0, 0, 0); for(my $i = 0; $i < $n; $i++) { my @array = split / /, <>; chomp $array[4]; if($array[4] eq 'YES') { for(my $j = 0; $j < 4; $j++) { $ans[$array[$j]]++; } } else { for(my $j = 0; $j < 4; $j++) { $ans[$array[$j]]--; } } } my $res = 0; my $count = $ans[0]; for(my $i = 1; $i < 10; $i++) { if($count < $ans[$i]) { $count = $ans[$i]; $res = $i; } } print "$res\n"; exit;