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+1_8)/2_8
  do i = 0_8, m-2_8
    write(*,'(i0,x,i0,x,i0)') k+2_8*i, k+3_8*m-i-2_8, k+4_8*m+i-2_8
    write(*,'(i0,x,i0,x,i0)') k+2_8*i+1_8, k+4_8*m-i-3_8, k+5_8*m+i-3_8
  end do
  if (mod(n,2_8) == 1_8) write(*,'(i0,x,i0,x,i0)') k+2_8*(m-1_8), k+2_8*m-1_8, k+6_8*m-4_8
end program non_triangular_triplets