program prob2
    implicit none
    integer::h, w, i
    character(len=105)::s
    read(*,*) h, w
    do i = 1, h
        read(*,*) s
        write(*,'(a)') s
        write(*,'(a)') s
    end do
    
    stop
end program