#include #include #include using namespace std; char S1[15], S2[45]; map M; int main(){ int n; scanf("%d",&n); while(n--){ scanf("%s%s", S1, S2); string s2 = S2; map::iterator it; if(S1[0]=='i'){ M[s2]++; } else if(S1[0] == 's'){ string s2 = S2; int flag = 0; for(it = M.lower_bound(S2); it != M.end(); it++){ string t = it->first; if(t.find(s2) != 0) break; if(it->second) { flag = 1; break; } } puts(flag?"Yes":"No"); } else{ for(it = M.lower_bound(S2); it != M.end(); it++){ string f = it->first; if(f.find(s2) != 0) break; it -> second=0; } } } return 0; }