#P8402. [CCC 2022 J3] Harp Tuning
[CCC 2022 J3] Harp Tuning
Problem Description
There is a harp, and like other instruments, it can go out of tune.
A computer science student with musical talent wrote 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 how many turns to rotate.
For example, the single line actually contains two tuning instructions:
and .
The first instruction means that the strings of the harp should be tightened by turns.
The second instruction means that the strings of the harp should be loosened by turns.
Your job is to make the single-line tuning instructions easier to read.
Input Format
One line. Input a string , whose meaning is described in the problem statement.
Output Format
Output several lines.
For each instruction, output the uppercase letters of the strings first; if the original instruction contains +, output tighten, otherwise output loosen; finally output the number of turns (separated by spaces).
AFB+8HC-4
AFB tighten 8
HC loosen 4
AFB+8SC-4H-2GDPE+9
AFB tighten 8
SC loosen 4
H loosen 2
GDPE tighten 9
Hint
For all testdata:
Translated by ChatGPT 5