use a single array to implement three stacks