program main implicit none integer i,j character*50001 a read(*,*)i if(mod(i,2)==0)then do j=1,i/2 a(j:j)="1" enddo else a(1:1)="7" do j=2,i/2 a(j:j)="1" enddo endif write(*,*)a(1:j) write(*,*) end program main