#include <iostream>
#include <cstdio>
#include <string>
#include <cstring>
using namespace std;
char pass[4000000];
int main(void)
{
freopen("stat.in","r",stdin);
freopen("stat.out","w",stdout);
int i,j,lw,lp,total=0,first=-1;
char word[40]={0};
bool found;
cin.getline(word,39);
cin.getline(pass,3999999);
lw=strlen(word);
lp=strlen(pass);
for (i=0;i<lw;i++)
if (word[i]>='A'&&word[i]<='Z')
word[i]=word[i]-'A'+'a';
for (i=0;i<lp;i++)
if (pass[i]>='A'&&pass[i]<='Z')
pass[i]=pass[i]-'A'+'a';
for (i=0;i<=lp-lw;i++)
{
found=true;
for (j=0;j<lw;j++)
{
if (word[j]!=pass[i+j])
{
found=false;
break;
}
}
if (found)
if (pass[i+lw]>='a'&&pass[i+lw]<='z')
found=false;
if (found)
if (i-1>=0)
if (pass[i-1]>='a'&&pass[i-1]<='z')
found=false;
if (found)
{
total++;
if (first==-1)
first=i;
}
}
if (total==0)
printf("-1\n");
else
printf("%d %d\n",total,first);
return(0);
}