# include <bits/stdc++.h>
using namespace std;
#define int long long
const int INF=0x7FFFFFFFFFFFFFFF;
string s,str;
signed main(){
ios::sync_with_stdio(false);
cin.tie(NULL); cout.tie(NULL);
getline(cin,s);
getline(cin,str);
for(char&ch:s){
ch=tolower(ch);
}
for(char&ch:str){
ch=tolower(ch);
}
s=' '+s+' ';
str=' '+str+' ';
if(str.find(s)==string::npos){
cout<<-1;
}
else{
int dex=0,sum=0;
while((dex=str.find(s,dex))!=string::npos){
sum++;
dex+=s.length();
}
cout<<sum<<" ";
cout<<str.find(s);
}
return 0;
}