compute the next permutation

visit shbcf.ru