private static int[] getWeights(int[][] words) {
		int height = words.length;
		int width = words[0].length;
		int[] result = new int[height];
		for (int i = 0; i < height; i++) {
			int weight = 0;
			for (int j = 0; j < width; j++) {
				if (words[i][j] > 0)
					weight += 1;
			}
			result[i] = weight;
		}
		return result;
	}