#39331: Python


zurichyofficial@gmail.com (Zurichyoz)


ip = str(input())
ans = str(input())
ilist = []
olist = []
for i in ip:
ilist.append(i)
for j in ans:
try:
n = ilist.index(j)
ilist[n] = "NONE"
olist.append(n + 1)
except:
olist.append("X")
print(*olist)