I can't tell whats wrong, I think its somewhere between lines 24 and 26
package com.codegym.task.task07.task0711;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.ArrayList;
/*
Remove and insert
*/
public class Solution {
public static void main(String[] args) throws Exception {
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
ArrayList<String> strList = new ArrayList<String>();
for(int i = 0; i < 5; i++){
String str = reader.readLine();
strList.add(str);
}
for (int i = 0; i < 13; i++){
String lastString = strList.get(strList.size()-1);
strList.remove(lastString);
strList.add(0, lastString);
}
for (int i = 0; i< strList.size(); i++){
int j = strList.size()-i-1;
System.out.println(strList.get(j));
}
}
}