You could make different ways, but here are two examples.
Make use of the stairs UID.
Floor_Up = Hold the UID of the the stair that it leads to on the upper floor.
Floor_Down = Hold the UID of the the stair that it leads to on the lower floor.
Give each stair a variable that identify them instead of the UID.
Stair_ID = <Stair_ID>
Floor_Up = Stair_ID to where it leads
Floor_Down = Stair_ID to where it leads
Stair_ID could be formatted so is holds the floor nr and a letter if there are more stairs on the same floor.
Example: "2a" would be the first stair on the second floor, "2b" the second stair.