void fill(int[][] A) {
		int n=A.length;
		boolean[][] b=new boolean[n][n];
		for (int i=0;i<n;++i)
			for (int j=0;j<n;++j) 
				if (A[i][j]!=-1) {
					b[i][A[i][j]]=true;
					b[j+n][A[i][j]]=true;
				}
		for (int i=0;i<n;++i) {
			for (int j=0;j<n;++j) {
				if (A[i][j]==-1) {
					for (int k=0;k<n;++k) {
						if (!b[i][k]&&!b[n+j][k]) {
							A[i][j]=k+1;
							break;
						}
					}
				}
			}
		}
	}