public class Breuk6 implements Cloneable {
	public Breuk6() { 
	}
	public Breuk6(int tt) {
		t=tt;
	} 
	public Breuk6(int tt, int nn) {
		t=tt; n=nn;
		normaliseer();
	}
	public Breuk6(Breuk6 b) {
		t=b.t; n=b.n;
	}
	public String toString()  {
		String s=new String();
		s=t+"/"+n;
		return s;
	}
	public boolean equals(Object obj) {
		if (obj instanceof Breuk6) {
			Breuk6 b=(Breuk6)obj;
			return t==b.t&&n==b.n;
		}
		return false;
	}
	public void add(Breuk6 b) {
		t=t*b.n+b.t*n;
		n*=b.n;
		normaliseer();
	}
   public int hashCode() {
      return new Integer(t).hashCode() + new Integer(n).hashCode();
   }
   public Object clone() {
      try {
         return super.clone();
      } catch (CloneNotSupportedException e) {
         /* can't happen really! */
      }
      return null;
   }
   protected void finalize() throws Throwable {
      super.finalize();
      System.out.println("Breuk: "+this+" destroyed.");
   }
 	//...
	private int ggd(int n, int m) {
		if (n==0) return m;
		if (m==0) return n;
		while (m!=n)
			if (n>m) n-=m;
			else m-=n;
		return n;
	}
	private void normaliseer() {
		if (n<0) {
			n=-n;
			t=-t;
		}
		int d=ggd(t<0?-t:t,n);
		t/=d;
		n/=d;
	}
	private int t=0;
	private int n=1;
}