java solution to the Einstein puzzle