https://123dok.net/document/zgw657p8-solving-discrete-logarithm-problem-packing-candidate-preferences.html