import java.util.Arrays; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner in = new Scanner(System.in); int[] score = new int[10]; Arrays.fill(score, 0); int N = in.nextInt(); for (int i = 0; i < N; i++) { int A,B,C,D; String R; A = in.nextInt(); B = in.nextInt(); C = in.nextInt(); D = in.nextInt(); R = in.next(); if ("NO".equals(R)) { score[A]--; score[B]--; score[C]--; score[D]--; } else { score[A]++; score[B]++; score[C]++; score[D]++; } } int max = score[0]; int ans = 0; for (int i = 1; i <= 9; i++) { if (max < score[i]) { max = score[i]; ans = i; } } System.out.println(ans); } }