
public class L<A> {
	boolean isEmpty;
	A head;
	L<A> tail;
	L<A> tail2;
	L(){
		isEmpty=true;
	}
	L(A h,L<A> t2){
		isEmpty=false;
		head=h;
		tail2=t2;
		tail= new L<A>();
	}
	L(L<A> t,A h){
		isEmpty=false;
		head=h;
		tail=t;
		tail2= new L<A>();
	}
	L(L<A> t,A h,L<A> t2){
		isEmpty=false;
		head=h;
		tail2=t2;
		tail=t;
	}

	static int count(L dies){
		return dies.count();
	}
	int count(){
		if (this.isEmpty) return 0;
		return this.tail.count()+this.tail2.count()+1;
	}
	boolean hatGeradeAnzahl(){
		if (isEmpty) return true;
		if (tail.isEmpty) return false;
		return tail.tail.hatGeradeAnzahl();
	}

	public static void main(String[] args) {
		L<String> xs = new L<String>("hallo",new L<String>());
		L<Integer> is = new L<Integer>(42,new L<Integer>());
	}
}
