set of stacks problem