str1 = input().lower()
sentence = input().lower()
cnt = 0
for i in sentence.split():
if i == str1:
cnt += 1
if cnt != 0:
print(cnt, end=" ")
for i in range(len(sentence)):
for j in range(len(str1)):
if sentence[i+j] != str1[j]:
break
if j == len(str1)-1 and sentence[i] == str1[0] and sentence[i+j+1] == " " and (i == 0 or sentence[i-1] == " "):
print(i)
break
else:
print(-1)