Doors and Penguins

SPOJ - DOORSPEN