```
public class Solution {
public static void main(String[] args) throws Exception {
//write your code here
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
ArrayList<String> list = new ArrayList<>();
for (int i = 0; i < 3; i++) {
list.add(reader.readLine());
}
//display the shortest or longest
//we should determine what makes it shortest or longest
int shortest = list.get(0).length();
int longest = list.get(0).length();
for (String value : list) {
if (value.length() < shortest) {
shortest = value.length();
} else if (value.length() > longest) {
longest = value.length();
}
}
for (String s : list) {
if (shortest == s.length()) {
System.out.println(s);
} else if (longest == s.length()) {
System.out.println(s);
}
}
}
}
```

Code is running fine but i`m stuck on displaying only one ...
package com.codegym.task.task07.task0712;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.ArrayList;
public class Solution {
public static void main(String[] args) throws Exception {
//write your code here
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
ArrayList<String> list = new ArrayList<>();
for (int i = 0; i < 10 ; i++) {
list.add(reader.readLine());
}
//display the shortest or longest
//we should determine what makes it shortest or longest
int shortest = list.get(0).length();
int longest = list.get(0).length();
for (int i = 0; i < list.size(); i++) {
if (list.get(i).length() < shortest){
shortest = list.get(i).length();
}else if (list.get(i).length()>longest){
longest = list.get(i).length();
}
}
for (int i = 0; i <list.size() ; i++) {
if (shortest == list.get(i).length()){
System.out.println(list.get(i));
}else if (longest == list.get(i).length()){
System.out.println(list.get(i));
}
}
}
}

the very first" Only show the first one. The for loop is not needed.