I wrote up this simple class that is my solution to the problem at this link: http://www.usaco.org/index.php?page=viewproblem2&cpid=964. This is my code: