public static void main(String[] args) throws Exception { //write your code here BufferedReader reader = new BufferedReader ( new InputStreamReader ( System.in ) ); for (int a = 0;a < 5;a++) { strings.add ( reader.readLine () ); } int max = strings.get ( 0 ).length (); for (int a = 1;a < 5;a++){ if(strings.get ( a ).length () > max){ max = strings.get ( a ).length (); } } for (int a = 0;a <= strings.size ();a++){ if(strings.get ( a ).length () == max) { System.out.println ( strings.get ( a ) ); } } } }