word = input()
alphabet = [chr(j) for j in range(97,123)]
for x in alphabet:
print(word.find(x), end=' ')
s = input()
alphabet = "abcdefghijklmnopqrstuvwsyz"
for x in alphabet:
print(s.find(x), end=" ")
my_list = [-1] * 26
s = list(map(ord, input()))
for i in range(len(s)):
if my_list[s[i]-ord('a')]== -1:
my_list[s[i]-ord('a')]= i
for i in my_list:
print(i, end=" ")