My code for the prologin 2013 contest.