import java.util.NoSuchElementException;
import java.util.Iterator;
import java.lang.Iterable;

class Box2 extends Box implements Iterable<Double> {

	public Box2(double x, double y, double z) {
		super(x,y,z);
	}

	public Iterator<Double> iterator() {
		return new Iterator<Double>() {
			private int count = 0;
		
			public boolean hasNext() {
				return count < 3;
			}

			public Double next() {
				count++;
				if (count == 1) {
					return getHeight();
				}
				else if (count == 2) {
					return getWidth();
				}
				else if (count == 3) {
					return getLength();
				} 
				else {
					throw new NoSuchElementException();
				}
			}
		};
	}
}
