public static void main(String[] args) throws Exception {
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        String[] words = new String[5];
        for(int i=0;i<5;i++){
            words[i] = reader.readLine();
        }
        ArrayList<String> list1 = new ArrayList<String>();

        for(int i=0;i<5;i++){
            list1.add(words[i]);
        }

        list1.remove(2);
        ArrayList<String> listReverse = new ArrayList<String>();
        for(int i=0;i<4;i++){
            listReverse.add(list1.get(4-i));
        }

        printList(listReverse);
    }

    public static void printList(ArrayList<String> list){
        for(String x: list)
                System.out.println(x);
    }
}