package com.codegym.task.task07.task0711;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Scanner;
/*
Remove and insert
*/
public class Solution {
public static void main(String[] args) throws Exception {
ArrayList<String> list = new ArrayList<String>();
Scanner sc = new Scanner(System.in);
for (int i = 0; i < 5; i++) {
String s = sc.nextLine();
list.add(0, s);
}
for(int i = 0; i < 13; i++){
String temp = null;
temp = list.get(list.size()-1);
list.add(0, temp);
list.remove(list.size()-1);
}
for (int k = 0; k < 5; k++) {
System.out.println(list.get(k));
}
}
}
package com.codegym.task.task07.task0711;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Scanner;
/*
Remove and insert
*/
public class Solution {
public static void main(String[] args) throws Exception {
ArrayList<String> list = new ArrayList<String>();
Scanner sc = new Scanner(System.in);
for (int i = 0; i < 5; i++) {
String s = sc.nextLine();
list.add(0, s);
}
for(int i = 0; i < 13; i++){
String temp = null;
temp = list.get(list.size()-1);
list.add(0, temp);
list.remove(list.size()-1);
}
for (int k = 0; k < 5; k++) {
System.out.println(list.get(k));
}
}
}