SPOJ 9510: Ads Proposal