Code for PROCON 2013 contest