#include<bits/stdc++.h>
#define int long long
using namespace std;
signed main(){
string w,a;
cin>>w;
getline(cin,a);
int c=0;
int f=-1;
int pos=0;
while((pos=a.find(w,pos))!=string::npos){
if(f==-1){
f=pos;
}
c++;
pos++;
}
if (c==0){
cout<<-1<<endl;
}else{
cout<<c<<" "<<f<<endl;
}
return 0;
}