How to solve the problem of piles