program answer
  implicit none
  integer(8) :: H, W, i, j
  character(len=100), allocatable :: C(:)
  read(*,*) H, W
  allocate(C(H))
  do i = 1, H
     read(*,*) C(i)
  end do


  do i = 1, 2*H
        if(mod(i,2)==0) then
           write(*,*) C(i/2)
        else
           write(*,*) C((i+1)/2)
        end if
  end do

  deallocate(C)
  stop
 end program answer