#include<bits/stdc++.h>
using namespace std;
int SEARCH(char *TEXT, char *PATTERN)
{
int i,j;
int M=strlen(PATTERN);
int N=strlen(TEXT);
for (i = 0; i <= N - M; i++)
{
for (j = 0; j < M; j++)
{
if (TEXT[i + j] != PATTERN[j])
break;
}
if (j == M)
return i;
}
return -1;
}
int main()
{
char TEXT[100],PATTERN[100];
scanf("%s%s",TEXT,PATTERN);
int LOC=SEARCH(TEXT,PATTERN);
if(LOC==-1)
cout<<"PATTERN is not in the TEXT" <<endl;
else
cout<<"PATTERN "<<PATTERN<<" is in the location "<<LOC+1<<endl;
return 0;
}
I2luY2x1ZGU8Yml0cy9zdGRjKysuaD4KdXNpbmcgbmFtZXNwYWNlIHN0ZDsKCmludCBTRUFSQ0goY2hhciAqVEVYVCwgY2hhciAqUEFUVEVSTikKewogICAgaW50IGksajsKICAgIGludCBNPXN0cmxlbihQQVRURVJOKTsKICAgIGludCBOPXN0cmxlbihURVhUKTsKICAgIGZvciAoaSA9IDA7IGkgPD0gTiAtIE07IGkrKykKICAgIHsKICAgICAgICBmb3IgKGogPSAwOyBqIDwgTTsgaisrKQogICAgICAgIHsKICAgICAgICAgICAgaWYgKFRFWFRbaSArIGpdICE9IFBBVFRFUk5bal0pCiAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICB9CiAKICAgICAgICBpZiAoaiA9PSBNKQogICAgICAgICAgICByZXR1cm4gaTsKICAgIH0KICAgIHJldHVybiAtMTsKfQoKaW50IG1haW4oKQp7CgljaGFyIFRFWFRbMTAwXSxQQVRURVJOWzEwMF07CiAgICBzY2FuZigiJXMlcyIsVEVYVCxQQVRURVJOKTsKICAgIAogICAgaW50IExPQz1TRUFSQ0goVEVYVCxQQVRURVJOKTsKCiAgICBpZihMT0M9PS0xKQogICAgICAgIGNvdXQ8PCJQQVRURVJOIGlzIG5vdCBpbiB0aGUgVEVYVCIgPDxlbmRsOwogICAgZWxzZQogICAgICAgIGNvdXQ8PCJQQVRURVJOICI8PFBBVFRFUk48PCIgaXMgaW4gdGhlIGxvY2F0aW9uICI8PExPQysxPDxlbmRsOwogICAgcmV0dXJuIDA7Cn0=