public class Rectangle implements Comparable<Rectangle> {
    // Public properties for height and width
    public double height;
    public double width;

    // Constructor to initialize height and width
    public Rectangle(double height, double width) {
        this.height = height;
        this.width = width;
    }

    // Method to calculate and return the area of the rectangle
    public double getArea() {
        return this.height * this.width;
    }

    // Method to calculate and return the diagonal length
    public double getDiagonalLength() {
        return Math.sqrt(this.height * this.height
                + this.width * this.width);
    }

    // Overriding compareTo method to compare rectangles by area
    @Override
    public int compareTo(Rectangle other) {
        return Double.compare(this.getArea(), other.getArea());
    }

    // Overriding toString method for easier printing of rectangles
    @Override
    public String toString() {
        return "Rectangle[height=" + height + ", width=" + width 
                + ", area=" + getArea() 
                + ", diagonal=" + getDiagonalLength() + "]";
    }

}
