/* Your MiniJava code: */
class Foo {
  public static void main(String[] args) {
    int size = 5;
    int[] arr = new int[size];
    arr[1] = 1;
    arr[2] = 2;
    arr[3] = 3;
    arr[4] = 4;

    int i = 0;
    while (i < size) { System.out.println(arr[i]); i = i + 1; }
    new Foo().reverse(arr, size);
    i = 0;
    while (i < size) { System.out.println(arr[i]); i = i + 1; }
  }

  public void reverse(int[] arr, int size) {
    int half = (size - 1) / 2;
    int source = 0;
    while (source <= half) {
      int target = size - 1 - source;
      int temp = arr[source];
      arr[source] = arr[target];
      arr[target] = temp;
      source = source + 1;
    }
  }
}