import java.lang.Comparable;

class Rock implements Comparable<Rock> {
	private float weight;
	public Rock(float weight) {
		this.weight = weight;
	}	

	@Override
	public String toString() {
		return "" + weight;
	}

	@Override
	public boolean equals(Object obj) {
		if(!(obj instanceof Rock)) { return false; }
		Rock r = (Rock) obj;
		return Math.abs(this.weight - r.weight) < 0.000001;
	}

	@Override
	public int hashCode() {
		return Float.floatToIntBits(weight);
	}

	public int compareTo(Rock r) {
		if(Math.abs(this.weight - r.weight) < 0.000001) {
			return 0;
		}
		else {
			return Float.compare(this.weight,r.weight);
		}
	}
}
