public class Solution {
public static void main(String[] args) throws IOException {
ArrayList<String> myList = new ArrayList<String>();
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
String s;
int i=0;
for (i=0;i<10;i++){
s = reader.readLine();
myList.add(s);
}
int longS = myList.get(0).length();
for (i=1;i<10;i++){
if (myList.get(i).length() < longS){
System.out.println(i);
break;
}
}
}
}
package com.codegym.task.task07.task0718;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
/*
Checking the order
*/
public class Solution {
public static void main(String[] args) throws IOException {
ArrayList<String> myList = new ArrayList<String>();
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
String s;
int i=0;
for (i=0;i<10;i++){
s = reader.readLine();
myList.add(s);
}
int longS = myList.get(0).length();
for (i=1;i<10;i++){
if (myList.get(i).length() < longS){
System.out.println(i);
break;
}
}
}
}