its showing correct index but not at correct position
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 {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
ArrayList<String> list = new ArrayList<String>();
for(int i=0; i<10; i++){
list.add(br.readLine());
}
for(int i=0; i<list.size(); i++){
for(int j=i+1; j<list.size(); j++){
if(list.get(i).length()<list.get(j).length()){
System.out.println();
}
else if(list.get(i).length()>list.get(j).length()){
System.out.println(list.indexOf(list.get(i)));
}
}
}
}
}