ICFPC practice: solving ants (https://web.archive.org/web/20060813151549/http://www.cis.upenn.edu/~plclub/contest/task.php)