def shift_decrypt(c, key):
l =len(key)
m =""
for iin range(0, len(c), l):
tmp_m = [""] * l
if i+l >=len(c):
tmp_c = c[i:]
re_key = []
for jin range(len(tmp_c)):
re_key.append(int(key[j])-1)
re_key.sort()
for jin range(len(tmp_c)):
tmp_m[j] = tmp_c[re_key.index(int(key[j])-1)]
else:
tmp_c = c[i:i+l]
for jin range(len(tmp_c)):
tmp_m[j] = tmp_c[int(key[j]) -1]
m +="".join(tmp_m)
return m
c ="110680192018100491042125221130151126610851139104301152208001012911044211110292065004710852130028"
key ="3124"
print(shift_decrypt(c, key))