#include<bits/stdc++.h>
using namespace std;
string word,test;
char ltos(char* t){
if(*t>='A'&&*t<='Z') *t=(char)(*t+('a'-'A'));
}
int main(){
int t,first,flag=1,k1,k2,cnt=0;
getline(cin,word);
getline(cin,test);
word=" "+word+" ";
test=" "+test+" ";
k1=word.size();
k2=test.size();
for(int i=0;i<k1;i++){
ltos(&word[i]);
}
for(int i=0;i<k2;i++){
ltos(&test[i]);
}
while(1){
t=test.find(word);
if(t==-1){
break;
}
if(flag){
first=t;
flag=0;
}
cnt++;
test.erase(t+1,2);
}
if(cnt==0) cout<<-1;
else cout<<cnt<<" "<<first;
return 0;
}