program ABC049B
    implicit none
    integer(8)::H,W,i,j
    character(100)::so
    character(100),dimension(100)::S
    read(5,*)H,W,(S(i),i=1,H)

    do i=1,2*H
        do j=1,W
            so(j:j)=S((i+1)/2)(j:j)
        end do
        print'(A)',so(1:W)
    end do
end program ABC049B