implement 3 stacks by using only 1 array