public static void main(String[] args) throws Throwable{
		BufferedReader in=new BufferedReader(new InputStreamReader(System.in));
		StringBuilder sb=new StringBuilder();int caso=1;
		for(StringTokenizer st;(st=new StringTokenizer(in.readLine()))!=null;caso++){
			int N=parseInt(st.nextToken()),V=parseInt(st.nextToken());
			if(N==0)break;
			ArrayList<Integer>[] lAdy=new ArrayList[N+1];
			int[][] mAdy=new int[N+1][N+1];
			for(int i=0;i<N+1;i++){
				lAdy[i]=new ArrayList<Integer>();
				for(int j=0;j<N+1;j++)if(i!=j)lAdy[i].add(j);
			}
			for(int i=0;i<N;i++){
				st=new StringTokenizer(in.readLine());
				for(int j=i+1;j<N+1;j++)mAdy[i][j]=mAdy[j][i]=parseInt(st.nextToken());
			}
			long min=N*V;
			for(int i=0;i<1<<N;i++)min=Math.min(prim(lAdy,mAdy,i,V),min);
			sb.append("Cable Net #"+caso+"\n"+V*N+"\n"+min+"\n\n");
		}
		System.out.print(new String(sb));
	}