package yukicoder; import java.util.Scanner; public class No24 {// 数当てゲーム public static void main(String[] args) { int[] num = new int[10]; Scanner sc = new Scanner(System.in); int N = sc.nextInt(); for (int i = 0; i < N; i++) { int[] h = new int[4];// Hint String s = null; h[0] = sc.nextInt(); h[1] = sc.nextInt(); h[2] = sc.nextInt(); h[3] = sc.nextInt(); s = sc.nextLine(); if (s.equals(" YES")) { yes(num, h); } else { no(num, h); } } sc.close(); int ans = 0; for (int i = 1; i < 10; i++) { if (num[ans] < num[i]) { ans = i; } } System.out.println(ans); } public static int[] yes(int[] num, int[] h) {// YESの場合 for (int i = 0; i < 4; i++) { num[h[i]]++; } return num; } public static int[] no(int[] num, int[] h) {// NOの場合 for (int i = 0; i < 4; i++) { num[h[i]]--; } return num; } }