class StockSpanner:

    def __init__(self):
        self.stack = []
        self.spans = []

    def next(self, price: int) ->int:
        ind = len(self.stack) - 1
        while ind >= 0 and self.stack[ind] <= price:
            temp = self.spans[ind]
            ind = ind - temp
        self.stack.append(price)
        temp = len(self.stack) - 1 - ind
        self.spans.append(temp)
        return temp

b9517ab8b339e3fe7aee24147adf24aed2f3f977
<mask token>

class StockSpanner:
    <mask token>
    <mask token>

class StockSpanner:
    <mask token>

    def next(self, price: int) ->int:
        ind = len(self.stack) - 1
        while ind >= 0 and self.stack[ind] <= price:
            temp = self.spans[ind]
            ind = ind - temp
        self.stack.append(price)
        temp = len(self.stack) - 1 - ind
        self.spans.append(temp)
        return temp

class StockSpanner:

    def __init__(self):
        self.stack = []
        self.spans = []

    def next(self, price: int) ->int:
        ind = len(self.stack) - 1
        while ind >= 0 and self.stack[ind] <= price:
            temp = self.spans[ind]
            ind = ind - temp
        self.stack.append(price)
        temp = len(self.stack) - 1 - ind
        self.spans.append(temp)
        return temp
