import Data.List (intersperse)

main :: IO ()
main = do
  [n, k] <- map read . words <$> getLine
  as <- map read . words <$> getLine
  let
    ias = zip [1..n] as
    eqk = foldr (\(i, a) r -> case compare a k of {LT -> Left ""; EQ -> case r of {Left _ -> r; Right Nothing -> Right (Just i); Right (Just _) -> Left ""}; _ -> r}) (Right Nothing) $ ias
    procedure i = do
      let
        q = (n * (k + 1) - 1)
        js = [1..(pred i)] ++ [(succ i)..n]
        ls = concat . intersperse " " . map show $ js
      print q
      mapM_ putStr . replicate k $ ls ++ " " ++ show i ++ " "
      putStrLn $ ls
  either (const $ print (-1)) (procedure . maybe n id) $ eqk
