9360: CCC '22 J3 - Harp Tuning
Description
The CCC harp is a stringed instrument with strings labelled A, B, …, T. Like other instruments, it can be out of tune.
A musically inclined computer science student has written a clever computer program to help tune the harp. The program analyzes the sounds produced by the harp and provides instructions to fix each string that is out of tune. Each instruction includes a group of strings, whether they should be tightened or loosened, and by how many turns.
Unfortunately, the output of the program is not very user friendly. It outputs all the tuning instructions on a single line. For example, the single line AFB+8HC-4 actually contains two tuning instructions: AFB+8 and HC-4. The first instruction indicates that harp strings A, F, and B should be tightened 8 turns, and the second instruction indicates that harp strings H and C should be loosened 4 turns.
Your job is to take a single line of tuning instructions and make them easier to read.
Input
Output
Constraints
Number of Letters in an Instruction $\leq 20$
Number of Turns $\leq 999,999$
Sample 1 Input
AFB+8HC-4
Sample 1 Output
AFB tighten 8
HC loosen 4
Sample 2 Input
AFB+8SC-4H-2GDPE+9
Sample 2 Output
AFB tighten 8
SC loosen 4
H loosen 2
GDPE tighten 9