#include<bits/stdc++.h>
#define int long long
#define N 100003
using namespace std;
string a,b;
int t;
int chec1k(){
t=b.find(a);
return t!=b.npos;
int p=b.find(a);
char v;
if(p==b.npos)return -1;
if(p==0&&(b[p+a.length()]==' '||b[p+a.length()]==v))return p;
if(p==b.length()-1&&b[p-a.length()]==' ')return p;
if(b[p-1]==' '&&b[p+a.length()]==' ')return p;
return -1;
}
#define int int
int main(){
freopen("killer.in","r",stdin);
freopen("killer.out","w",stdout);
#define int long long
getline(cin,a);
getline(cin,b);
a=' '+a+' ';
b=' '+b+' ';
for(int i=0;i<a.length();i++){
if(a[i]>='A'&&a[i]<='Z')a[i]+=('a'-'A');
}
for(int i=0;i<b.length();i++){
if(b[i]>='A'&&b[i]<='Z')b[i]+=('a'-'A');
}
if(b.find(a)==b.npos)cout<<-1;
else{
int p=b.find(a);
int ans=0;
while(b.find(a)!=b.npos){
ans++;
b[b.find(a)]='.';
}cout<<ans<<" "<<p;
}
}