program non_triangular_triplets
  implicit none
  integer(8) :: n, k, i, m
  read(*,*) n, k
  if (2_8*k-1_8 > n) then
    write(*,'(i0)') -1
    stop
  end if
  m = n/2_8
  do i = 0_8, m-1_8
    write(*,'(i0,x,i0,x,i0)') k+2_8*i, k+3_8*m-i+1_8, k+4_8*m+i
    write(*,'(i0,x,i0,x,i0)') k+2_8*i+1_8, k+4_8*m-i+1_8, k+5_8*m+i
  end do
  if (mod(n,2_8) == 1_8) write(*,'(i0,x,i0,x,i0)') k+2_8*m, k+2_8*m+1_8, k+5_8*m
end program non_triangular_triplets