a="ABCDEFGHIJKLMNOPQRSTUVWXYZ"
k="QWERTYUIOPASDFGHJKLZXCVBNM"

t=input("Plain text: ").upper()
e="".join(k[a.index(c)] if c in a else c for c in t)
print("Encrypted:",e)

c=input("Cipher text: ").upper()
d="".join(a[k.index(c)] if c in k else c for c in c)
print("Decrypted:",d)