시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 1024 MB100564865.753%

문제

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.

입력

There will be one line of input which is a sequence of tuning instructions. Each tuning instruction will be a sequence of uppercase letters, followed by a plus sign (+) or minus sign (-), followed by a positive integer. There will be at least one instruction and at least one letter per instruction. Also, each uppercase letter will appear at most once.

출력

There will be one line of output for each tuning instruction. Each line of output will consist of three parts, each separated by a single space: the uppercase letters referring to the strings, tighten if the instruction contained a plus sign or loosen if the instruction contained a minus sign, and the number of turns.

서브태스크 1 (5점)

  • Number of Instructions ≤ 1
  • Number of Letters in an Instruction ≤ 20
  • Number of Turns ≤ 9

Example Input: AFB+8

서브태스크 2 (5점)

  • Number of Instructions ≤ 20
  • Number of Letters in an Instruction ≤ 1
  • Number of Turns ≤ 9

Example Input: A+8H-4

서브태스크 3 (3점)

  • Number of Instructions ≤ 20
  • Number of Letters in an Instruction ≤ 20
  • Number of Turns ≤ 9

Example Input: AFB+8HC-4

서브태스크 4 (2점)

  • Number of Instructions ≤ 20
  • Number of Letters in an Instruction ≤ 20
  • Number of Turns ≤ 999 999

Example Input: AFB+88HC-444

예제 입력 1

AFB+8HC-4

예제 출력 1

AFB tighten 8
HC loosen 4

The input contains two tuning instructions: AFB+8 and HC-4.

예제 입력 2

AFB+8SC-4H-2GDPE+9

예제 출력 2

AFB tighten 8
SC loosen 4
H loosen 2
GDPE tighten 9

The input contains four tuning instructions: AFB+8, SC-4, H-2, and GDPE+9.

채점 및 기타 정보

  • 예제는 채점하지 않는다.