import Control.Arrow
import Control.Monad
import Data.List
import qualified Data.ByteString.Char8 as B
import Data.Bits

main :: IO ()
main = readLine >>= printRes . solve
    where
        printRes = putStrLn . unwords . map show

solve :: [Int] -> [Int]
solve [m, k] 
    | k >= 2 ^ m = [-1]
    | m == 0 && k == 0 = [0, 0]
    | m == 1 && k == 0 = [0, 0, 1, 1]
    | m < 2 = [-1]
    | otherwise = k : [0..(k - 1)] ++ [(k + 1)..(2 ^ (m - 1))] ++ [k] ++ [(2 ^ (m - 1)), (2 ^ (m - 1) - 1)..(k + 1)] ++ [(k - 1), (k - 2)..0]

readLine :: IO [Int]
readLine = unfoldr (fmap (second (maybe B.empty snd . B.uncons)) . B.readInt) <$> B.getLine

readContents :: Int -> IO [[Int]]
readContents = flip replicateM readLine