p=input().lower() t=input().lower() ls=t.split() lsls=[] for i in range(len(ls)): if p==ls[i]: lsls.append(i) else: continue if len(lsls)==0: print(-1) else: print(len(lsls),lsls[0])