You are standing in a hallway. In front of you is an open door and three light switches. Inside the open door is a room with three incandescent light bulbs hanging from the ceiling. Each switch in the hallway controls one of the lights, but you do not know which switch controls which light. Your job is to determine which switch belongs to which light.

Before you begin, you must close the door. You can then flip switches as many times as you like, but you may only open the door once and then you can no longer use the switches. Assume no light leaks through the door.

How do you accomplish this?