Let the number of men and women in the room be represented by an arbitrary constant, x and y respectively.
x + y = 96
y = 96 - x
When one man leaves, we get: x - 1
When one woman replaces the man, we get: y + 1
So, y + 1 = 3(x - 1)
Substituting y = 96 - x, we get:
96 - x + 1 = 3x - 3
97 + 3 = 4x
100 = 4x
x = 25
Thus, there were 25 men and 41 women in the room originally.