private static String[][][] getExpressions(int statesCount, int eventsCount, List<String> vars, int[][] cnt,
			Random random) {
		String[][][] ans = new String[statesCount][eventsCount][];
		for (int stateNum = 0; stateNum < statesCount; stateNum++) {
			for (int eventNum = 0; eventNum < eventsCount; eventNum++) {
				int size = 0;
				if (cnt[stateNum][eventNum] >= 0) {
					size = (int) Math.pow(2, cnt[stateNum][eventNum]);
				}
				ans[stateNum][eventNum] = new String[size];

				if (size == 0) {
					continue;
				}
				if (size == 1) {
					ans[stateNum][eventNum][0] = "1";
					continue;
				}

				List<String> curVars = choice(vars, cnt[stateNum][eventNum], random);

				for (int mask = 0; mask < size; mask++) {
					String s = "";
					int i = mask;
					for (int var = 0; var < cnt[stateNum][eventNum]; var++) {
						if (var > 0) {
							s += " & ";
						}
						if (i % 2 == 0) {
							s += "~";
						}

						s += curVars.get(var);

						i /= 2;
					}
					ans[stateNum][eventNum][mask] = s;
				}
			}
		}

		return ans;
	}