stdin.ReadLine() |> ignore stdin.ReadLine().Split(' ') |> Seq.map int |> Seq.groupBy int |> Seq.maxBy (fun (n,s) -> Seq.length s * 10 + n) |> fst |> printfn "%d"