program cojs624;
var
s1:string;
s2:ansistring;
ans,i,j,k,m,n,t:longint;
begin
assign(input,'stat.in');
assign(output,'stat.out');
reset(input);
rewrite(output);
readln(s1);
readln(s2);
m:=length(s1);
n:=length(s2);
ans:=0;
for i:=1 to m do
if s1[i] in ['A'..'Z'] then
s1[i]:=chr(ord(s1[i])-ord('A')+ord('a'));
for i:=1 to n do
begin
if s2[i] in ['A'..'Z'] then
s2[i]:=chr(ord(s2[i])-ord('A')+ord('a'));
if (s2[i]=s1[m])and
(not(s2[i+1] in['a'..'z','A'..'Z']))
and(s1=copy(s2,i-m+1,m))
and(not(s2[i-m] in['a'..'z','A'..'Z'])) then
begin
inc(ans);
if ans=1 then
k:=i-m;
end;
end;
if ans=0 then
writeln(-1)
else
writeln(ans,' ',k);
close(input);
close(output);
end.