package error1;

import java.util.Scanner;

public class IsLeapYear {

	public static class LeapYearException extends Exception {
	}

	public static class NotLeapYearException extends Exception {
	}

	static void checkLeapYear(String year) throws LeapYearException,
			NotLeapYearException, NumberFormatException {

		long yearAsLong = Long.parseLong(year);

		//
		// A leap year is a multiple of 4, unless it is
		// a multiple of 100, unless it is a multiple of
		// 400.
		//
		// We calculate the three values, then make a
		// 3-bit binary value out of them and look it up
		// in results.
		//

		final boolean results[] = { true, false, false, true, false, false,
				false, false };

		if (results[((((yearAsLong % 4) == 0) ? 1 : 0) << 2)
				+ ((((yearAsLong % 100) == 0) ? 1 : 0) << 1)
				+ ((((yearAsLong % 400) == 0) ? 1 : 0) << 0)]) {
			throw new LeapYearException();
		} else {
			throw new NotLeapYearException();
		}
	}

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String year = sc.next();
		if (year.length() > 0) {

			try {
				checkLeapYear(year);
			} catch (NumberFormatException nfe) {
				System.out.println("Invalid argument: " + nfe.getMessage());
			} catch (LeapYearException lye) {
				System.out.println(year + " is a leap year");
			} catch (NotLeapYearException nlye) {
				System.out.println(year + " is not a leap year");
			}
		}
	}
}