03-02 Codeforces Round 1083 (Div. 2)——CF-2205-E. Simons and Dividing the Rhythm(分析分段 rev 操作的方法即 \text{rev}(XY) = \text{rev}(Y)\text{rev}(X))