Anton and Permutation

CodeForces - 785E