It helps to know that GRAMMATICAL "gender" means "type"! A bunch of words use the same endings as the word for "knife", a bunch use the same endings as "rock", etc.
I may not have the NUMBER of genders correct, but it doesn't affect the joke.
English is very rare in equating gender and sex--male things use he, female things use she, unknown or neuter things use it.