In most places, you can't do work on multi-tenant buildings unless you are a licensed electrician. Two of the reasons are:
- Safety/Liability - Some things that might seem to work could put yourself, and other tenants, in danger.
- Nuisance - A trained electrician will know how to do the work faster and therefore inconvenience all the other tenants for a much shorter period of time.
So you really can't do this yourself. Call the landlord (if it is a rental) or whoever is in charge of common area maintenance (if you own your apartment). Even if you happen to own the entire building, you still need a licensed electrician to do the work.
All that being said, a couple of things for the more general case (e.g., if this was in a single-family home):
- A wire is a single copper or aluminum conductor inside installation. It is typically identified by color.
- A cable contains multiple wires, generally each one a different color, inside a an outer wrapping.
In this case, it appears you have 4 wires, not cables. The terminology does matter.
- Always take pictures before doing any work, unless there is exactly one way to connect things (e.g., only 2 wires). That way for a straight switch replacement, which I suspect is the situation here, you can connect the way the previous switch was connected.
In this specific situation, you may be dealing with a 3-way/4-way switch configuration. (US terminology - it may be different in your location.) With a 3-way/4-way switch configuration, the first switch (e.g., bottom floor) will have "1 in, 2 travelers", the last switch (e.g., top floor) will have "2 travelers, 1 out" and all the other switches (e.g., middle floors) will have "2 travelers in, 2 travelers out". I mention that because that looks sort of like your diagram - i.e., all black wires as travelers in/out of a 4-way switch. But then again, you have a red wire out to the light, which if it is real does not match but might just be conceptual.
If this were a single-family home, I would ask for pictures and a lot more details. But since it is not, hire an electrician.