Почему не проходит?
package com.javarush.task.task07.task0711;
import java.util.ArrayList;
import java.io.*;
/*
Удалить и вставить
*/
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 x = 0; x<5; x++){
list.add(0, reader.readLine());
}
for(int x = 0; x<13; x++){
list.add(0,list.remove(list.size()-1));
}
for(int x = 0; x<list.size(); x++){
System.out.println(list.get(x));
}
}
}