#include <iostream>

using namespace std;

int main()
{
    int Number[9] = {0,0,0,0,0,0,0,0,0};
    char cNumber[9] = {'1','2','3','4','5','6','7','8','9'};

    int x;

    while(cin >> x)
    {
        //+1 for each x element
        for(int a = 1; a <= 9; a++)
        {
            if(x == a)
            {
                Number[a-1]++;
            }
        }
    }

    for(int b = 0; b < 9; b++)
    {
        for(int c = 0; c < 8; c++)
        {
            if(Number[c] < Number[c+1])
            {
                int temp = Number[c];
                Number[c] = Number[c+1];
                Number[c+1] = temp;

                char ctemp = cNumber[c];
                cNumber[c] = cNumber[c+1];
                cNumber[c+1] = ctemp;
            }
        }
    }

    int y = 0;
    for(int d = 1; d < 9; d++)
    {
        if(Number[0] != Number[d])
        {
            break;
        }
        else
        {
            y++;
        }

    }

    for(int e = 0; e <= y; e++)
    {
        cout << cNumber[e] << endl;
    }


}