import java.io.*;
import java.util.*;

public class Main{
    public static void main(String[] args)throws Exception{
        Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
        PriorityQueue<String> s=new PriorityQueue<String>();
        Queue<String> t=new ArrayDeque<String>();
        for(int i=0;i<n;i++){
            s.add(sc.next());
        }
        int max=0;
        while(s.peek()!=null){
            String str=s.peek();
            int i=0;
            for(;s.peek()!=null&&s.peek().equals(str);i++){
                s.remove();
            }
            if(max==i){
                t.add(str);
            }else if(max<i){
                max=i;
                t.clear();
                t.add(str);
            }
        }
        while(t.peek()!=null){
            System.out.println(t.remove());
        }
    }
} import java.io.*; io.* java import java.util.*; util.* java public class Main{
    public static void main(String[] args)throws Exception{
        Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
        PriorityQueue<String> s=new PriorityQueue<String>();
        Queue<String> t=new ArrayDeque<String>();
        for(int i=0;i<n;i++){
            s.add(sc.next());
        }
        int max=0;
        while(s.peek()!=null){
            String str=s.peek();
            int i=0;
            for(;s.peek()!=null&&s.peek().equals(str);i++){
                s.remove();
            }
            if(max==i){
                t.add(str);
            }else if(max<i){
                max=i;
                t.clear();
                t.add(str);
            }
        }
        while(t.peek()!=null){
            System.out.println(t.remove());
        }
    }
} Main public static void main(String[] args)throws Exception{
        Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
        PriorityQueue<String> s=new PriorityQueue<String>();
        Queue<String> t=new ArrayDeque<String>();
        for(int i=0;i<n;i++){
            s.add(sc.next());
        }
        int max=0;
        while(s.peek()!=null){
            String str=s.peek();
            int i=0;
            for(;s.peek()!=null&&s.peek().equals(str);i++){
                s.remove();
            }
            if(max==i){
                t.add(str);
            }else if(max<i){
                max=i;
                t.clear();
                t.add(str);
            }
        }
        while(t.peek()!=null){
            System.out.println(t.remove());
        }
    } main {
        Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
        PriorityQueue<String> s=new PriorityQueue<String>();
        Queue<String> t=new ArrayDeque<String>();
        for(int i=0;i<n;i++){
            s.add(sc.next());
        }
        int max=0;
        while(s.peek()!=null){
            String str=s.peek();
            int i=0;
            for(;s.peek()!=null&&s.peek().equals(str);i++){
                s.remove();
            }
            if(max==i){
                t.add(str);
            }else if(max<i){
                max=i;
                t.clear();
                t.add(str);
            }
        }
        while(t.peek()!=null){
            System.out.println(t.remove());
        }
    } Scanner sc=new Scanner(System.in); sc new Scanner(System.in) int n=sc.nextInt(); n sc.nextInt() sc.nextInt sc PriorityQueue<String> s=new PriorityQueue<String>(); s new PriorityQueue<String>() Queue<String> t=new ArrayDeque<String>(); t new ArrayDeque<String>() for(int i=0;i<n;i++){
            s.add(sc.next());
        } int i=0; int i=0; i 0 i<n i n i++ i++ i {
            s.add(sc.next());
        } {
            s.add(sc.next());
        } s.add(sc.next()) s.add s sc.next() sc.next sc int max=0; max 0 while(s.peek()!=null){
            String str=s.peek();
            int i=0;
            for(;s.peek()!=null&&s.peek().equals(str);i++){
                s.remove();
            }
            if(max==i){
                t.add(str);
            }else if(max<i){
                max=i;
                t.clear();
                t.add(str);
            }
        } s.peek()!=null s.peek() s.peek s null {
            String str=s.peek();
            int i=0;
            for(;s.peek()!=null&&s.peek().equals(str);i++){
                s.remove();
            }
            if(max==i){
                t.add(str);
            }else if(max<i){
                max=i;
                t.clear();
                t.add(str);
            }
        } String str=s.peek(); str s.peek() s.peek s int i=0; i 0 for(;s.peek()!=null&&s.peek().equals(str);i++){
                s.remove();
            } ; s.peek()!=null&&s.peek().equals(str) s.peek()!=null s.peek() s.peek s null s.peek().equals(str) s.peek().equals s.peek() s.peek s str i++ i++ i {
                s.remove();
            } {
                s.remove();
            } s.remove() s.remove s if(max==i){
                t.add(str);
            }else if(max<i){
                max=i;
                t.clear();
                t.add(str);
            } max==i max i {
                t.add(str);
            } t.add(str) t.add t str if(max<i){
                max=i;
                t.clear();
                t.add(str);
            } max<i max i {
                max=i;
                t.clear();
                t.add(str);
            } max=i max i t.clear() t.clear t t.add(str) t.add t str while(t.peek()!=null){
            System.out.println(t.remove());
        } t.peek()!=null t.peek() t.peek t null {
            System.out.println(t.remove());
        } System.out.println(t.remove()) System.out.println System.out System System.out t.remove() t.remove t String[] args args public class Main{
    public static void main(String[] args)throws Exception{
        Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
        PriorityQueue<String> s=new PriorityQueue<String>();
        Queue<String> t=new ArrayDeque<String>();
        for(int i=0;i<n;i++){
            s.add(sc.next());
        }
        int max=0;
        while(s.peek()!=null){
            String str=s.peek();
            int i=0;
            for(;s.peek()!=null&&s.peek().equals(str);i++){
                s.remove();
            }
            if(max==i){
                t.add(str);
            }else if(max<i){
                max=i;
                t.clear();
                t.add(str);
            }
        }
        while(t.peek()!=null){
            System.out.println(t.remove());
        }
    }
} public class Main{
    public static void main(String[] args)throws Exception{
        Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
        PriorityQueue<String> s=new PriorityQueue<String>();
        Queue<String> t=new ArrayDeque<String>();
        for(int i=0;i<n;i++){
            s.add(sc.next());
        }
        int max=0;
        while(s.peek()!=null){
            String str=s.peek();
            int i=0;
            for(;s.peek()!=null&&s.peek().equals(str);i++){
                s.remove();
            }
            if(max==i){
                t.add(str);
            }else if(max<i){
                max=i;
                t.clear();
                t.add(str);
            }
        }
        while(t.peek()!=null){
            System.out.println(t.remove());
        }
    }
} Main
import java.io.*;
import java.util.*;

public class Main{
    public static void main(String[] args)throws Exception{
        Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
        PriorityQueue<String> s=new PriorityQueue<String>();
        Queue<String> t=new ArrayDeque<String>();
        for(int i=0;i<n;i++){
            s.add(sc.next());
        }
        int max=0;
        while(s.peek()!=null){
            String str=s.peek();
            int i=0;
            for(;s.peek()!=null&&s.peek().equals(str);i++){
                s.remove();
            }
            if(max==i){
                t.add(str);
            }else if(max<i){
                max=i;
                t.clear();
                t.add(str);
            }
        }
        while(t.peek()!=null){
            System.out.println(t.remove());
        }
    }
}