#include<stdio.h>
#include<string.h>
#include <stdbool.h>
int main()
{
char*p,*q;
char str1[100],str2[10000000];
bool flag=false;
gets(str1);
gets(str2);
int temp,count=0;
for(int i=0;i<100;i++)
{
if(str1[i]==0)
{
break;
}
if(str1[i]>=97&&str1[i]<=122)
{
str1[i]-=32;
}
}
for(int i=0;i<10000000;i++)
{
if(str2[i]==0)
{
break;
}
if(str2[i]>=97&&str2[i]<=122)
{
str2[i]-=32;
}
}
p=str2;
while(1)
{
q=strstr(p,str1);
if(q==NULL)
{
break;
}
else
{
if(flag==false)
{
flag=true;
temp=(int)(q-&str2[0]);
}
count++;
p+=strlen(str1);
}
}
if(flag==true)
{
printf("%d %d",count,temp);
}
else
{
printf("-1");
}
return 0;
}