I guess I am wrong with this part:
System.out.println(list.get(list.size() - i));
The whole code:
public class Solution {
    public static void main(String[] args) throws Exception {
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        ArrayList<String> list = new ArrayList<String>();
        for(int i = 0; i < 5; i++){
            list.add(reader.readLine());
        }
        list.remove(2);
        for(int i = 0; i < list.size() ; i++) {
            System.out.println(list.get(list.size() - i));
        }
    }
}