using namespace std;
int x,y,z;int a[10006];
string k,l;
int main()
{
getline(cin,k);
getline(cin,l);
x=l.find(k);
if(x!=-1)
{
cout<<k<<" is substring of "<<l;
return 0;
}
else
{
x=k.find(l);
if(x!=-1)
{
cout<<l<<" is substring of "<<k;
return 0;
}
}
cout<<"No substring";
return 0;
} c