import Control.Monad
import Data.Char
import Data.Maybe
import Data.List
import qualified Data.ByteString.Char8 as B
import qualified Data.Vector.Unboxed as V

readInt = B.readInt . B.dropWhile isSpace

getInt = fst . fromJust . readInt <$> B.getLine

getIntList = unfoldr readInt <$> B.getLine

main = do
  [n,  k] <- getIntList
  if k /= 1
    then print (-1)
    else forM_ [[i, 2*n + 1 - i, 2*n + i]|i <- [1..n]] (putStrLn . unwords . (map show))