#include<iostream>
#include<cstdio>
#include <iomanip>
#include<cmath>
#include<string>
using namespace std;
int main()
{
string word, sentence;
getline(cin, word);
getline(cin, sentence);
int w = word.size();
int s = sentence.size();//不能用int s=strlen(word)
//把单词 句子全部转换成大写
for(int i=0;i<w;i++)
word[i]= toupper(word[i]);//toupper转换成大写字母函数
for (int j = 0; j < s; j++)
sentence[j] = toupper(sentence[j]);
int t = 0;//记录第一个出现的相同的字母
int count = 0;//记录相同个数的单词
for (int k = 1; k <= s - w; k++)//指向句子的
{
//q指向单词
int q = 0;
for ( q; q < w; ++q)
{
if (sentence[k + q] != word[q] )
break;
if (k>0&&sentence[k - 1] != ' ')
break;//不是空格开头不是一个单词
}
if (q == w && (sentence[k +w] == ' '||k+w+q==s))//刚开始写的是sentence[k +1] == ' ',没有考虑到k其实根本没变
{
count++;
if (count == 1)
t = k;
}
}
if (count != 0)
cout << count <<" "<< t;
else cout << -1;
return 0;
}