#include<stdio.h>
#include<iostream>
#include<algorithm>
#include<string>
#include<cstring>
using namespace std;
string s,p;
int next_[257];
void getnext(){
int len=p.size();
for(int i=0;i<256;i++)next_[i]=-1;
for(int i=0;i<len;i++)next_[p[i]]=i;
}
int sunday(){
int slen=s.size();
int plen=p.size();
if(slen==0)return -1;
for(int i=0;i<slen-plen;){
int j=i;
int k=0;
for(;k<plen&&j<slen&&s[j]==p[k];j++,k++);
if(k==plen)
return i;
else{
if(i+plen<slen)i+=(plen-next_[s[i+plen]]);
else return -1;
}
}
return -1;
}
int main(){
s="I love DNF and Code";
p="love";
getnext();
if(sunday())printf("you find it at %d\n",sunday());
else printf("sorry,you do not find it!\n");
}