implement 3 stacks from one array