#Z01643. 哇! 天呐 26个字母!
哇! 天呐 26个字母!
题目描述
Little Sub builds a naive Enigma machine of his own. It can only be used to encrypt/decrypt lower-case letters by giving each letter a unique corresponding lower-case letter. In order to ensure the accuracy, no contradiction or controversy is allowed in both the decryption and the encryption, which means all lower-case letters can only be decrypted/encrypted into a distinct lower-case letter. Now we give you a string and its encrypted version. Please calculate all existing corresponding relationship which can be observed or deducted through the given information. 小P同学有幸参加了第十二届杭师大校赛(当然,被大佬按在地板上摩擦了),其中有一道题,做的小P同学想吃键盘(当然,没有吃),独气气并不如众气气 , 所以小P同学决定和大家一起分享 , 所以特地Copy了过来(嘿嘿嘿)。
输入格式
The first line contains a string S, indicating the original message. The second line contains a string T , indicating the encrypted version. The length of S and T will be the same and not exceed 1000000.
输出格式
we use a string like ’x->y’ to indicate that letter x will be encrypted to letter y. Please output all possible relationships in the given format in the alphabet order. However, if there exists any contradiction in the given information, please just output Impossible in one line. Each sample will follow a blank line.
banana
cdfdfd
banana
cdfdfs
a->d
b->c
n->f
Impossible
提示
物联1882PZH 到HZNUOJ一嫖 。author : YE,Zicheng。
豫公网安备41072702000346号