Guess How the Ballet Will End

Problem Name:
Guess How the Ballet Will End
Site:CodeForces
Links:
Tags: