const main = (input) => {
	const args = input.split(" ");
	const H = parseInt(args[0]);
	const W = parseInt(args[1]);
	const K = parseInt(args[2]);

	
}

main(requrie("fs").readFileSync("/dev/stdin", "utf8"));