mcmf solves http://imcs.dvfu.ru/cats/static/problem_text-cpid-934202.html SA