...
package com.javarush.task.task07.task0709;
/*
Выражаемся покороче
*/
import java.io.*;
public class Solution {
public static void main(String[] args) throws Exception {
//напишите тут ваш код
int short = 0;
ArrayList<String> text = new ArrayList<>();
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
for (int a = 0; a < 5; a++) {
String small = reader.readLine();
text.add(small);
if (small.length() < short) {
short = small.length();
}
}
ArrayList<String> minimum = new ArrayList<>();
for (int a = 0; a < 5; a++) {
if (text.get(a).length() == short) {
minimum.add(text.get(a));
}
}
for (String victory : minimum) {
System.out.println(victory);
}
}
}