Convention is grey= neutral, brown= permanent live and black = switched L, but there are variations so you would normally check to confirm that.
In that case brown and E you safely terminate as they are not used. Black to the fan blue, and grey to the fan black
What's the red and black...