#include <bits/stdc++.h>
#define int long long
#define iostream() ios::sync_with_stdio(false),cin.tie(NULL),cout.tie(NULL);
using namespace std;
const int maxn = 1e6+7;
const int MAXN = maxn / 2;
string change(string s)
{
for (int i = 0; i < s.length(); i++)
if (s[i] >= 'A' && s[i] <= 'Z')
s[i] += 32;
return s;
}
signed main()
{
iostream();
string s,temp;
bool flag = 0;
int cnt = 0,bold = 0,i = 0;
cin >> s;
s = change(s);
while (cin >> temp)
{
temp = change(temp);
if (temp == s)
{
cnt++;
if (!flag)
{
flag = 1;
bold = i;
}
}
i++;
}
if (flag) printf("%d %d",cnt,bold);
else puts("-1");
return 0;
}