public class Cow implements Comparable<Cow> {
    private int weight;
    private String name;
  
    public Cow() {
        this(1800, "Anonymous Cow");
    }
  
    public Cow(int weight, String name) {
        this.weight = weight;
        this.name = name;
    }
  
    public int compareTo(Cow otherCow) {
        if (weight > otherCow.getWeight()) {
            return 1;
        } else if (weight < otherCow.getWeight()) {
            return -1;
        } else {
            return 0;
        }
    }
   
    public String toString() {
        return (name);
    }
}