405250: GYM101858 B Battle Sequence
Description
You are one of the $$$1000$$$ lucky people invited to test Sword Art Online closed beta.
The game is very unique and extremely beautiful. But it's still a game.
While battling Illfang, the Kobold Lord, you recognize some attack patterns:
- Illfang only have two attacks, Chop and Slice.
- If Illfang uses the same attack $$$3$$$ times in a row, just before the third attack it stops to charge.
- If Illfang is attacked during it's charge, it does not continue that attack.
Knowing these patterns you came up with an strategy to defeat it:
- Every time Illfang uses a Chop attack, you will defend with a Block.
- Every time Illfang uses a Slice attack, you will Dash.
- If Illfang begins to charge a Chop, you will attack with Plunge.
- If Illfang begins to charge a Slice, you will attack with Tackle.
Your guild gathered information about the attack sequence of Illfang and your job is to determine your attack sequence to defeat it.
InputThe only line of input contains one string $$$s$$$ ($$$|s| \le 100$$$) — Illfang's attack sequence. 'C' means Illfang will use a Chop attack. 'S' means Illfang will use a Slice attack.
OutputPrint one string — your attack sequence to defeat Illfang. 'B' means you will use a Block. 'D' means you will use a Dash. 'P' means you will use a Plunge. 'T' means you will use a Tackle.
ExamplesInputCSCCCSOutput
BDBBPDInput
CCSSSSSSCOutput
BBDDTDDTB