5. Look at the paper. It show that 18 is on the left, 6 is on the right, and green is on the bottom.
For the 18, if you count the gaps along the edges + the holes on the inside on the red cog, you'll find a total of 18.
As for the 6, this one is a bit more tricky. The black cog you pulled off the wall was fastened by a screw with 6 sides.
Look at the gearbox and put the red cog on the left, black cog on the right, and the yellow+blue cog on the bottom.
Spikes will disappear on a part of the wall. Press it to open the door.
Hit like if this walkthrough helped you! Thanks :)