implement 3 stacks with one single array