Mirror Image

Time limit1sMemory limit128 MB

Problem

The lowercase letters b and d, and p and q, are mirror images of each other. In addition, i, o, v, w, and x are each their own mirror image. Other letters have mirror-image relationships as well, but in this problem only the letters listed above are considered to have a mirror image.

Because of this symmetry, a word made up only of these letters can be recovered just from how it looks in a mirror. When a word is reflected in a mirror, the order of its letters is reversed and each letter is replaced by its own mirror image. For example, boowxod reflected in a mirror becomes boxwood, and bidi becomes ibid.

Given several words, find the mirror image of each one. If a word contains any letter other than those listed above, its mirror image cannot be represented.

Input

Each line contains one word consisting only of lowercase letters. The length of each word does not exceed 10.

The last line of the input is a single # character, which marks the end of the input.

Output

For each word, print its mirror image on its own line if it can be represented; otherwise, print INVALID.