family tree problem solution