var
s:string;
st:ansistring;
i,p,mm,len,lent,count,position:longint;
begin
assign(input,'stat.in'); reset(input);
assign(output,'stat.out'); rewrite(output);
readln(s);
readln(st);
len:=length(s);
lent:=length(st);
mm:=ord('a')-ord('A');
for i:=1 to len do
if s[i] in ['A'..'Z'] then s[i]:=chr(ord(s[i])+mm);
for i:=1 to lent do
if st[i] in ['A'..'Z'] then st[i]:=chr(ord(st[i])+mm);
count:=0; position:=0;
st:=' '+st+' ';
s:=' '+s+' ';
p:=pos(s,st);
if p>0 then begin inc(count); position:=p-1; delete(st,1,p+len); end;
p:=pos(s,st);
while p>0 do
begin
inc(count); delete(st,1,p+len);
p:=pos(s,st);
end;
if count=0 then writeln(-1)
else writeln(count,' ',position);
close(input); close(output);
end.