let h, w = Scanf.scanf " %d %d" @@ fun a b -> a, b
let css = Array.init h @@ fun _ -> Scanf.scanf " %s" @@ fun s -> s
let _ =
  for i = 0 to h * 2 - 1 do
    for j = 0 to w - 1 do
      print_char css.(i / 2).[j] done;
    print_newline () done