import java.util.*;

/**
 * A random number generator that
 * produces integers that are uniformly distributed
 * between 2 and 6.
 * 
 * You must not modify this class.
 */
 
public class MyRandom {

    // This class will produce RANGE different random values, the lowest
    // being LOWVALUE.
    private static final int RANGE = 5;
    private static final int LOWVALUE = 2;
    
    // A general random number generator.  We will use it to produce random
    // numbers without a range limit, and then will trim them to be in our
    // desired range.
    private Random random;
    
    /**
     * Constructs a restricted random number generator.
     *
     * @param int seed to initialize the generator.
     */
     
    public MyRandom(int seed) {
    
        random = new Random(seed);
    }
    
    /**
     * Returns the next integer in the random number sequence.
     *
     * @return integer uniformly distributed between LOWVALUE 
     * and LOWLEVEL + RANGE - 1.
     */
     
    public int nextInt() {
    
        return (Math.abs(random.nextInt()) % RANGE) + LOWVALUE;
    }
    
    /** 
     * Test driver for MyRandom.
     */
     
    public static void main(String[] args) {
    
        MyRandom test = new MyRandom(98765);
        
        for(int i=0; i<10; i++) {
        
            System.out.println(test.nextInt());
        }
         
    }
}
