#include <bits/stdc++.h>
using namespace std;
int main(){
string s1,s2;
getline(cin,s2);
getline(cin,s1);
int count = 0,index,len1=s1.length(),len2=s2.length();
for(int i=0;i<len1;i++){
if(s1[i]>='A' && s1[i]<='Z'){
s1[i]+='a'-'A';
}
}
for(int i=0;i<len2;i++){
if(s2[i]>='A' && s2[i]<='Z'){
s2[i]+='a'-'A';
}
}
int i,j;
for(i=0;i<len1;i++){
for(j=0;j<len2;j++){
if(s1[i+j]!=s2[j]){
break;
}
if(i>0 && s1[i-1]!=' ') break;
}
if(jlen2 && (s1[i+j]' ' )){
count++;
if(count==1){
index = i;
}
}
}
if(count!=0){
cout<<count<<" "<<index;
}else{
cout<<"-1";
}
return 0;
}