
function Main(input) {
input = input.split("\n");
    input.sort();
	console.log(input[length]);
		console.log(input[length-1]);
			console.log(input[length-2]);
}
  
Main(require("fs").readFileSync("/dev/stdin", "utf8"));