program y2;
var
word,article:ansistring;
i,p,s,len:longint;
begin
readln(word);
word:=' '+upcase(word)+' ';
len:=length(word);
readln(article);
article:=' '+upcase(article)+' ';
p:=-1;
for i:=1 to length(article)-len+1 do
if copy(article,i,len)=word then
begin
if p=-1 then p:=i-1;
inc(s);
end;
if p=-1 then writeln(p)
else writeln(s,' ',p);
end.
/**************************************************************
Problem: 2301
User: admin
Language: Pascal
Result: Wrong Answer
****************************************************************/