At the upcoming Mactoberfest, Graham has learned that plenty of witches and wizards will be attending. In order to impress them, he's been practicing two new spells.
The first spell is Confetticus
C
, which creates a confetti explosion.It has an undoing spell, Janitorum
J
, which cleans up the confetti created by it's respective confetti explosion.The second spell is Rainborimus
R
, which summons a rainbow.It has an undoing spell, Sunshinio
S
, which dissipates the rainbow.
Multiple spells can be cast in a row, but the latest active spell must be undone first, or else the magic will fail and he will embarrass himself. All spells cast must eventually be undone otherwise it fails. Given a set of spells that Graham plans to cast, help Graham by identifying if that set is impressive, meaning that it works, or if it's embarrassing, meaning it will fail.
Input Specification
A string of characters C
, J
, R
, and S
, representing the spells to be cast, confetticus, janitorum, rainborimus, and sunshinio respectively. The string will always be at least 2 characters.
Output Specification
The word impressive
if the set of spells doesn't fail, and embarrassing
if it does.
Sample Input 1
CCJRSJ
Sample Output 1
impressive
Sample Input 2
CRJS
Sample Output 2
embarrassing
Comments