Implementation of 3 stacks using single array