My (incomplete) submission to Google CodeJam 2013.