import std.algorithm;
import std.array;
import std.conv;
import std.stdio;
import std.string;

void main(){
    int[] data;
    for(;!stdin.eof;)
        data ~= readln.chomp.to!int;
    
    data.sort;
    auto d = data.group.array;
    sort!"a[1] > b[1]"(d);
    d.filter!(a => a[1] == d[0][1]).map!(a => (a[0].writeln, 0)).array;
}