chapter3 stack exercises