str1=input().lower() str2=input().lower().split() # 获取str2的长度 l=len(str2) d=[] num=0 for i in str2: if i==str1: num+=1 for j in range(l): d.append(j) if num>0: print(num,min(d)) else: print(-1)