// Arup Guha
// 7/8/04 - This program prompts the user for a positive year and
//          determines whether it is a leap year or not.

import java.io.*;

class Leapyear2 {

    public static void main(String argv[]) throws IOException {

	BufferedReader stdin = new BufferedReader
	    (new InputStreamReader(System.in));

	int year; 
	boolean result = false; // Default the year to not be a leap year.

	// Reads in a year from the user.
	System.out.println("Enter a year: ");
	year = Integer.parseInt(stdin.readLine());

	// If year is divisible by 4, change it to be a leap year, temporarily.
	if (year%4 == 0)
	    result = true;

        // We've mistakenly turned result to true if year is divisible by
        // 100 but not 400.
        if (year%100 == 0 && year%400 != 0)
		result = false;

	// Outputs result to the screen.
	if (result)
	    System.out.println("The year " + year + " was a leap year.");
	else
	    System.out.println("The year " + year + " was not a leap year.");
    }

}
