The algorithm of Petya (#3237) - Basecamp