let read h =
	let rec f img = function
		| 0 -> img
		| n ->
			let line = read_line () in
			f (line::line::img) (n - 1)
	in f [] h |> List.rev

let rec print = function
	| [] -> () 
	| x::xs -> print_string x;print_newline ();print xs

let _ =
	Scanf.scanf "%d %d" (fun h w -> read h) |> print 
