using System.Collections.Generic;
static void Main(string[] args)
int N = Convert.ToInt32(Console.ReadLine());
string[,] candidateArray = new string[N, 2];
candidateArray[i, 0] = Console.ReadLine();
candidateArray[i, 1] = Console.ReadLine();
int M = Convert.ToInt32(Console.ReadLine());
var votes = new List<String>();
votes.Add(Console.ReadLine());
var mostVotes = votes.GroupBy(k => k).OrderByDescending(grp => grp.Count()).Select(grp => grp.Key).Where(x => x != null).First();
for (int l = 0; l < candidateArray.GetLength(0); ++l)
if (candidateArray[l, 0].Equals(mostVotes))
if (candidateArray[indexRow, 1] == null || candidateArray[indexRow, 1].Length == 0)
Console.WriteLine("Independent");
Console.WriteLine(candidateArray[indexRow, 1]);