print$a=$b=<>;<>;$c=$_,print$a for<>;$_=$a^$b^$c;s/\^ *K|K *\^/'*'x length($&)/e;tr/5/K/;print