import java.util.Scanner; public class No24 { public static void main(String[] args) { //数当てゲーム int[] num = new int[10]; Scanner s = new Scanner(System.in); int N = Integer.parseInt(s.nextLine()); String[] abcd = new String[N]; for(int i = 0;i < N;i++) { abcd[i] = s.nextLine(); } s.close(); for(String str : abcd) { int d; if(str.contains("NO")) { d = -1; }else { d = 1; } for(int i = 0;i < 4;i++) { num[Integer.parseInt(str.split(" ")[i])] += d; } } int max = 1; for(int i = 1;i < 10;i++) { if(num[i] > num[max]) { max = i; } } System.out.println(max); } }