function Main (input) {
    var raw = input.split("\n");
    var sorted = input.sort(function(a, b){return (b - a);});
    console.log(sorted.slice(0, 2).join(" "));
}

Main(require("fs").readFileSync("/dev/stdin", "utf8"));