solve Apple-Tree