Rotation applier

Input:

Output: