#include<bits/stdc++.h>
using namespace std;
int next[100];
string father,son;
void getnext(){
next[0]=-1;
int j=0,k=-1;
while(j<son.size()){
if(k==-1||son[j]==son[k])next[++j]=++k;
else k=next[k];
}
}
int kmp(){
getnext();
int i=0,j=0;
while(i<(int)father.size()&&j<(int)son.size()){
if(j==-1||father[i]==son[j])i++,j++;
else j=next[j];
}
if(j<(int)son.size())return -1;
return i-j;
}
int main(){
cin>>father>>son;
cout<<kmp()<<endl;
cout<<(0<father.size())<<endl;
cout<<(-1<father.size())<<endl;
cout<<(-1<(int)father.size());
}