import java.util.*;
import java.io.*;

public class PrintInReverse{
	public static void main(String [] args) throws Exception {
		String filename = "../../numbers.text";

		int count = getNumIntsInFile(filename);
		for (int i = count; i > 0; i--)
			printNthInt(filename, i);
	}

	static int getNumIntsInFile(String filename) throws Exception {
		Scanner scanner = new Scanner(new File(filename));
		int count = 0;

		while (scanner.hasNextInt()) {
			count++;
			scanner.nextInt();	// skip
		}

		return count;
	}

	static void printNthInt(String filename, int n) throws Exception  {
		Scanner scanner = new Scanner(new File(filename));
		// skip n-1 integers
		for (int i = 1; i < n; i++)
			scanner.nextInt();
		System.out.println(scanner.nextInt()); // Print the n'th integer
	}
}
