//#include #include #include #include #include #include #include #include #include #include #include #include #include #define sqr(x) (x)*(x) #define eps 1e-10 #define lson (p<<1) #define rson (lson | 1) using namespace std; const int N = 1e5+10; const int M = 1e6+10; typedef long long llg; struct Node { int num,snum; Node* son[30]; Node() {for(int i=0;i<30;i++) son[i] = NULL;num=snum=0;} }*rt,*tmp; char s[33],p[33]; void Insert(char* s) { tmp = rt; tmp->num++; for(int i=0;s[i];i++) { if(tmp->son[s[i]-'a' ] == NULL) tmp->son[s[i]-'a' ] = new Node(); tmp = tmp->son[s[i]-'a' ]; tmp->num++; } } void Del(char* s) { int i; tmp = rt; for(i=0;s[i];i++) { if(tmp->son[s[i]-'a' ] == NULL) return; tmp = tmp->son[s[i]-'a' ]; } int k = tmp->num; tmp = rt; for(i=0;s[i];i++) { //if(tmp->son[s[i]-'a' ] == NULL) return; tmp->son[s[i]-'a' ]->num -= k; if(tmp->son[s[i]-'a' ]->num == 0) { tmp->son[s[i] - 'a'] = NULL; return; } tmp = tmp->son[s[i]-'a' ]; } //tmp->son[s[i]-'a' ] = NULL; } bool Find(char* s) { tmp = rt; for(int i=0;s[i];i++) { if(tmp->son[s[i]-'a' ] == NULL) return 0; tmp = tmp->son[s[i]-'a' ]; } return 1; } int main() { int n; while(~scanf("%d",&n) ) { rt = new Node(); //for(int i=0;i<10;i++) cout<<(rt->son[i] == NULL)<