Elementary problem of stack