let () =
  Scanf.scanf "%d %d" @@ fun n k ->
  let a = Array.init n (fun _ -> Scanf.scanf " %d" ((+) 0)) in
  let ok = Array.fold_left (fun b v -> b && v*2 >= k) true a in
  if not ok then print_endline "-1"
  else begin
    let m = Array.fold_left min 100 a in
    Printf.printf "%d\n" (m*n);
    for _ = 1 to m do for i = 1 to n do Printf.printf "%d " i done done;
    print_newline ()
  end

