A note on the problem of heaps