// A Java Program to detect cycle in an undirected graph
import java.io.*;
import java.util.*;

// This class represents a directed graph using adjacency list
// representation

public class Main {
    // Driver method to test above methods
    public static void main(String args[]) throws IOException {

        File file = new File(args[0]);
        BufferedReader buffer = new BufferedReader(new FileReader(file));
        String line;
        while ((line = buffer.readLine()) != null) {
            line = line.trim();
            String[] splitArr = line.split("\\s+");

            int[][] arr = new int[splitArr.length][2];
            for (int i = 0; i < arr.length; i++) {
                arr[i][0] = Integer.parseInt(splitArr[i]);
                arr[i][1] = 0;
            }

            ///for each int
            for (int i = 0; i < arr.length; i++) {
                //find the corresponding value and increment
                for (int j = 0; j < arr.length; j++) {
                    if (arr[j][0] == arr[i][0]) {
                        ++arr[j][1];
                        break;
                    }
                }
            }

            int largestFrequency = 0;
            //for each int
            for (int i = 0; i <arr.length ; i++) {
                //find the largest frequency
                if (arr[i][1] > largestFrequency) {
                    largestFrequency = arr[i][1];
                }
            }

            ArrayList<Integer> arrayList = new ArrayList<>();
            //for each int
            for (int i = 0; i <arr.length ; i++) {
                //find all the integers with the largest frequency and them to the list
                if (arr[i][1] == largestFrequency) {
                    arrayList.add(arr[i][0]);
                }
            }

            String s = "";
            for (Integer value : arrayList) {
                s += value + " ";
            }

            System.out.println(s.trim());
        }
    }
}