public class Main {
	public static void main(String[] args) {
		int[] stuff = { 3, 8, 1, 4, 7, 2, 5 };
		reverse(stuff);
		printArray(stuff);
	}
	
	public static void swap(int[] arr, int index1, int index2) {
		int temp = arr[index1];
		arr[index1] = arr[index2];
		arr[index2] = temp;
	}
	
	public static void reverse(int[] arr) {
		for (int i = 0; i < arr.length/2; i++) {
			swap(arr, i, arr.length - i - 1);
		}
	}
	
	public static void printArray(int[] arr) {
		for (int thing : arr) {
			System.out.print(thing + " ");
		}
	}
}