###### hdu1004字典树
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Queue;
import java.util.Scanner;
import java.util.Stack;
import java.util.StringTokenizer;

import javax.management.Query;

public class Main {

public static void main(String[] args) {
PrintWriter out = new PrintWriter(System.out);

int n , m  ;
while((n = in.nextInt()) != 0){
}

out.flush() ;
}

}

static class TNode{
char  c ;
int   size  ;
TNode[] next ;
public TNode(){
next = new TNode[26] ;
size = 0 ;
}
public TNode(char c){
this.c = c ;
next = new TNode[26] ;
size = 0 ;
}
}

void  solve(int n , InputReader in , PrintWriter out){
String mx = null ;
TNode root = new TNode() ;
int res = 0 ;
for(int i = 0 ; i < n ; i++){
String s = in.next() ;
TNode now = root ;
for(char c : s.toCharArray()){
int d = c - 'a' ;
if(now.next[d] == null){
now.next[d] = new TNode(c) ;
}
now = now.next[d] ;
}
now.size++ ;
if(res <now.size){
mx = s ;
res = now.size ;
}
}

out.println(mx) ;
}
}

public StringTokenizer tokenizer;

tokenizer = null;
}

public String next(){
while(tokenizer == null || !tokenizer.hasMoreTokens()){
try{
}catch (IOException e) {
throw new RuntimeException(e);
}
}
}

public int nextInt() {
return Integer.parseInt(next());
}

}

#### hdu 1004 java

2015-01-11 08:30:12

#### (解题报告)HDU1004---Let the Balloon Rise

2015-11-08 13:13:49

#### hdu 1004 map写法

2014-04-20 19:45:03

#### HDU 1004 C语言

2017-07-12 20:14:16

#### HDU1004(枚举）

2016-02-02 21:24:04

#### Let the Balloon Rise hdu1004 字典树

2017-02-20 20:02:14

#### HDU1004 Let the Balloon Rise【字典树】

2015-04-21 20:14:11

#### hdu1004Let the Balloon Rise(map容器经典例题)

2015-09-01 19:38:56

#### hdu1004 map水题

2011-04-25 14:16:00

#### 字典树数组实现

2014-08-06 21:04:05

hdu1004字典树