#K65712. Mirror Word Checker
Mirror Word Checker
Mirror Word Checker
This problem is about checking whether a given string is a "Mirror Word". A string is considered a Mirror Word if all its characters belong to the set \(\{A, H, I, M, O, T, U, V, W, X, Y\}\) and the string reads the same forwards and backwards (i.e. it is a palindrome).
For example, the string "AHA" is a Mirror Word because:
- Every character is in the allowed set: A, H, A.
- The string "AHA" is a palindrome.
If both conditions are satisfied, output Mirror!!
, otherwise output NOT!!
.
Note: An empty string is considered a Mirror Word.
inputFormat
The input consists of a single line containing a string (s) composed of uppercase alphabetic characters. The string may be empty.
outputFormat
Print a single line: Mirror!!
if s
is a Mirror Word, or NOT!!
otherwise.## sample
AHA
Mirror!!