int trie[MAXN][26];
int color[MAXN];
int k = 1;
void insert(char *s) {
int len = strlen(s);
int p = 0;
for(int i = 0; i < len; i++) {
int c = s[i] - 'a';
if(!trie[p][c]) {
trie[p][c] = k;
k++;
}
p = trie[p][c];
}
color[p] = 1;
}
int search(char *s) {
int len = strlen(s);
int p = 0;
for(int i = 0; i < len; i++) {
int c = s[i] - 'a';
if(!trie[p][c]) return 0;
p = trie[p][c];
}
return color[p] == 1;
}