program em
implicit none
integer::N,M
integer::i
read*,N,M
do i=1,M
select case(mod(i,2))
case(0)
  print"(i0,A,i0)",M/2+1-i/2," ",M/2+1+i/2
case(1)
  print"(i0,A,i0)",(3*M)/2+1-i/2," ",(3*M)/2+2+i/2
end select
end do
contains
end program em