시간 제한 메모리 제한 제출 정답 맞은 사람 정답 비율
1 초 128 MB 88 45 41 63.077%

문제

소문자 b와 d나 p와 q는 서로 거울상 관계이다. 또한 i,o,v,w와 x는 모두 자신과 거울상 관계이다. 이 외에도 몇 가지 거울상 관계인 문자들이 존재하지만, 이 문제에서는 위에서 언급한 문자들만 거울상 관계로 생각하도록 하자.

이러한 대칭성으로 인해 위의 문자들로 이루어진 단어들은 거울에 비친 모습을 보고 거울에 반사되기 전 모습을 유추하는 것이 가능하다. 예를들어, 'boxwood'는 반사되기 전 'boowxod', 'ibid'는 반사되기 전 'bidi'라는 단어일 것이다. 몇 단어들이 주어질 때, 거울에 비춰지기 전 모습을 표현할수 있는지 판단하여라.

입력

입력으로 한 줄에 하나씩 소문자로만 이루어진 단어가 주어진다. 입력의 마지막줄에는 # 한 글자가 입력으로 주어진다.

출력

각 줄마다 거울에 비춰지기 전 모습이 표현가능하다면 그 거울상의 모습을 출력하고 그렇지 않다면 'INVALID'를 출력한다.

예제 입력 1

boowxod
bidi
bed
bbb
#

예제 출력 1

boxwood
ibid
INVALID
ddd
W3sicHJvYmxlbV9pZCI6IjQ1ODMiLCJwcm9ibGVtX2xhbmciOiIwIiwidGl0bGUiOiJcdWFjNzBcdWM2YjhcdWMwYzEiLCJkZXNjcmlwdGlvbiI6IjxwPlx1YzE4Y1x1YmIzOFx1Yzc5MCBiXHVjNjQwIGRcdWIwOTggcFx1YzY0MCBxXHViMjk0IFx1YzExY1x1Yjg1YyBcdWFjNzBcdWM2YjhcdWMwYzEgXHVhZDAwXHVhY2M0XHVjNzc0XHViMmU0LiBcdWI2MTBcdWQ1NWMgaSxvLHYsd1x1YzY0MCB4XHViMjk0IFx1YmFhOFx1YjQ1MCBcdWM3OTBcdWMyZTBcdWFjZmMgXHVhYzcwXHVjNmI4XHVjMGMxIFx1YWQwMFx1YWNjNFx1Yzc3NFx1YjJlNC4gXHVjNzc0IFx1YzY3OFx1YzVkMFx1YjNjNCBcdWJhODcgXHVhYz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2010 Mid-Central Regional Programming Contest E번

  • 문제를 번역한 사람: fromis_9
  • 잘못된 번역을 찾은 사람: jh05013