#include<cstdio>
#include<map>
#include<string>
#include<algorithm>
#include<vector>
#include<iostream>
using namespace std;
int main (){
int cnt=0;
map <string,int> list;
map <string,int> firstplace;
string word;
cin >> word;
for (int i=0;i<word.length();i++){
word[i]=tolower(word[i]);
}
string temp;
while (cin >> temp)
{
for(int i=0;i<temp.length();i++)
{
temp[i]=tolower(temp[i]);
}//标准化
if(!list[temp]) {
list[temp]=0;
firstplace[temp]=cnt;
}
cnt++;
list[temp]+=1;
temp="";
}
if(!list[word]) printf("-1");
else{
printf("%d %d",list[word],firstplace[word]);
}
return 0;
}````