import java.util.Scanner;
public class name {
public static void main(String[] args) {
Scanner input=new Scanner(System.in);
String[]name=new String[5];
for (int i=0; i<5; i++){
System.out.print("Enter a name: ");
name[i]=input.nextLine();
}
System.out.println("The names in reverse order");
for (int i=0; i<5; i++){
name[i-1]=name[i];
System.out.println("\n"+ name[i]);
}
System.out.println("The third person is "+name[3]);
}
}