import numpy as np
from qiskit import QuantumCircuit, Aer
import matplotlib.pyplot as plt

angles = np.array([ord("Z")-ord(i) for i in input().upper()])
print(angles)
angles = 2*np.arcsin(np.sqrt(angles/25))
print(angles)
n = len(angles)

qc = QuantumCircuit(n,n)
for i in range(len(angles)):
    qc.ry(angles[i],i)
qc.draw()

#for i in range(len(angles)):
#    qc.ry(-angles[i],i)
qc.measure(range(4),range(4))
qc.draw()

backend_sim = Aer.get_backend('qasm_simulator')
job_sim = backend_sim.run(qc, shots=1024)
result_sim = job_sim.result()

counts = result_sim.get_counts()

arr = [0 for _ in range(n)]
for state, count in counts.items():
    state = state[::-1]
    for i in range(n):
        arr[i] += int(state[i])*count/1024
        
output = ""
for i in range(n):
    output += chr(ord("A")+25-int(round(arr[i]*25,0)))
print(output)