open System
open System.IO

let rec readlines () = seq {
    let line = Console.ReadLine()
    if not (isNull line) then
        yield line
        yield! readlines ()
}

let readFields() = readlines() 
                    |> Seq.filter (String.IsNullOrEmpty >> not) 
                    |> Seq.collect (fun(x) -> x.Split ' ' ) 
                    |> Seq.filter (String.IsNullOrEmpty >> not)


[<EntryPoint>]
let main argv =
    let key2count = readlines() 
                        |> Seq.skip 1
                        |> Seq.countBy id
                        |> Array.ofSeq

    let (key, max) = key2count |> Array.maxBy (fun (key, count) -> count )

    
    key2count |> Array.filter (fun (key, count) -> count = max) 
              |> Array.map (fun (key, count) -> key) 
              |> Array.sort
              |> Array.iter (printfn "%s")
    
    0