import java.util.*;
public class Tort implements Comparable<Tort>{
	int x, y;
	public Tort(int x, int y){
		//Ne egyszerűsítsük!
		this.x=x;
		this.y=y;
	}
	public int getX(){
		return x;
	}
	public int getY(){
		return y;
	}
	public void setX(int x){
		this.x=x;
	}
	public void setY(int y){
		this.y=y;
	}
	@Override
	public String toString(){
		return ""+x+"/"+y;
	}
	@Override
	public int hashCode(){
		return x/y; //3ICE: Nem kell bonyolítani, alapból lefelé kerekít az int osztás: (int)Math.floor(x/y);
	}
	@Override
	public boolean equals(Object obj){
		if(obj==null){return false;}
		if(this==obj){return true;}
		if(this.getClass() != obj.getClass()){return false;}
		if(((Tort)obj).getX()==this.x &&((Tort)obj).getY()==this.y){return true;}
		//működjön a törteknél elvárt módon (ugyan az az értékük)
		if((double)((Tort)obj).getX()/((Tort)obj).getY() == (double)x/y){return true;}
		return false;
	}
	@Override
	public int compareTo(Tort other){
		if(this.equals(other)){
			//System.out.print((double)other.getX()/other.getY());
			//System.out.print(" .equals ");
			//System.out.println((double)x/y);
			return 0;
		}
		if((double)other.getX()/other.getY() < (double)x/y){
			//System.out.print(other.getX()/other.getY());
			//System.out.print(" < ");
			//System.out.println((double)x/y);
			return 1;
		}
		if((double)other.getX()/other.getY() > (double)x/y){
			//System.out.print(other.getX()/other.getY());
			//System.out.print(" > ");
			//System.out.println((double)x/y);
			return -1;
		}
		//3ICE: Ha egyszerűsítés után ==:
		//System.out.print((double)other.getX()/other.getY());
		//System.out.print(" == ");
		//System.out.println((double)x/y);
		return 0;
	}
}