/* package whatever; // don't place package name! */

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

class IntFrom0to1 {
	public class InvalidValueException extends Exception {
		public InvalidValueException(String message) {
			super(message);
		}
	}

	int value;
	public IntFrom0to1(int value) throws InvalidValueException {
		if(value != 0 && value != 1)
			throw new InvalidValueException("Value is out of range");
		this.value = value;
	}
}

/* Name of the class has to be "Main" only if the class is public. */
class Ideone
{
	public static void main (String[] args) 
	{

			IntFrom0to1 a = new IntFrom0to1(0);
			IntFrom0to1 b = new IntFrom0to1(2);
		

	}
}
