Use stacks to mimic the towers and use recursion to solve the problem.
if want to move n disks from a to c through b, there're 3 steps:
1) move n-1 disks from a to b through c
2) move the largest disk from a to c
3) move the n-1 disks (mentioned in the first step) from b to c through a