.. :/ ..
package com.codegym.task.task07.task0712;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
/*
Shortest or longest
*/
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<String>();
for (int i = 0; i < 10; i++)
list.add(reader.readLine());
boolean isComeFirst = false;
String shortestPos = "";
String longestPos = "";
int shortest = list.get(0).length();
int longest = list.get(0).length();
for (int i = 0; i < 10; i++) {
if (list.get(i).length() <= shortest) {
shortest = list.get(i).length();
shortestPos = list.get(i);
}
if (list.get(i).length() >= longest) {
longest = list.get(i).length();
longestPos = list.get(i);
}
}
if (list.indexOf(shortestPos) < list.indexOf(longestPos)) {
isComeFirst = true;
System.out.println(shortestPos);
}
else {
System.out.println(longestPos);
}
}
}