It works, but does not pass verify
package com.codegym.task.task07.task0708;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;
/*
Longest string
*/
public class Solution {
private static List<String> string = new ArrayList<String>();
public static void main(String[] args) throws Exception {
BufferedReader reader = new BufferedReader(new InputStreamReader (System.in));
String a = reader.readLine();
String s = reader.readLine();
String d = reader.readLine();
String b = reader.readLine();
String c = reader.readLine();
for (int i = 0; i < 5; i++);
{
string.add(a);
string.add(s);
string.add(d);
string.add(b);
string.add(c);
}
int max = string.get(0).length();
for (int i = 0; i < string.size(); i++)
{
if (string.get(i).length() > max)
{
max = string.get(i).length();
}
}
for (int i = 0; i < 5; i++)
{
if (string.get(i).length() == max)
System.out.println(string.get(i));
}
}
}