Grammatically speaking, it applies to men (pl.), but people use it nowadays to greet everyone, man, men, woman or women.