public class Solution { private static List<String> strings; public static void main(String[] args) throws Exception { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); strings = new ArrayList<String>(); for(int i = 0;i < 5;i++) { strings.add(br.readLine()); } int longest = strings.get(0).length(); for(int j = 1;j < strings.size();j++) { int temp = strings.get(j).length(); if(longest < temp) longest = temp; } for(int k = 0;k < strings.size();k++) { if(longest == strings.get(k).length()); System.out.println(strings.get(k)); } } }