Thomas is the best student in his class. One would think that it is fantastic for him to know all the stuff their teacher is speaking about... but unfortunately, he keeps becoming very very bored during the lessons. To prevent himself from falling asleep he draws silly drawings into his notebook, solves funny riddles, plays with paper and so on... A few minutes ago he wrote a long sentence on a slip of paper and now and then he flips the slip (so that the sentence becomes reversed and upside-down) and cuts off one quarter of letters (rounding down if necessary) from the right side of the remaining part of the slip.
However, the teacher does not like students that do not pay attention during his lectures. So as soon as he noticed Thomas is playing with the slip of paper he seized it. Bored Thomas would like to continue his game. To do this, however, he needs to know what exactly was written on the slip at the moment it was seized. Naturally, he remembers the original sentence and the number of rotate&cuts.
2 1 IWantToSleep 2 ZZZOutput:
ntToSleep ZZZ
Credits:
Problemsetter(s): Martin
Contest-related materials: Martin, Palo