class RecodeStack:
    recodes = []
    ptr = -1

    def __init__(self):
        super(RecodeStack, self).__init__()

    # pageIndex 页面下标
    # tag 附信息
    def insert(self, pageIndex, tag=None):
        self.ptr += 1
        del self.recodes[self.ptr:len(self.recodes)]
        self.recodes.insert(self.ptr, [pageIndex, tag])

    def backward(self):
        self.ptr -= 1
        return self.recodes[self.ptr]

    def forward(self):
        self.ptr += 1
        return self.recodes[self.ptr]

    def isBegin(self):
        return self.ptr == 0

    def isDeadline(self):
        return self.ptr == len(self.recodes) - 1


recodeStack = RecodeStack()

8d9d939d98f06c0ff5945f49ac5f7bad9001d075
class RecodeStack:
    <mask token>
    <mask token>
    <mask token>

    def insert(self, pageIndex, tag=None):
        self.ptr += 1
        del self.recodes[self.ptr:len(self.recodes)]
        self.recodes.insert(self.ptr, [pageIndex, tag])

    def backward(self):
        self.ptr -= 1
        return self.recodes[self.ptr]

    def forward(self):
        self.ptr += 1
        return self.recodes[self.ptr]

    def isBegin(self):
        return self.ptr == 0
    <mask token>


<mask token>

class RecodeStack:
    <mask token>
    <mask token>
    <mask token>

    def insert(self, pageIndex, tag=None):
        self.ptr += 1
        del self.recodes[self.ptr:len(self.recodes)]
        self.recodes.insert(self.ptr, [pageIndex, tag])

    def backward(self):
        self.ptr -= 1
        return self.recodes[self.ptr]

    def forward(self):
        self.ptr += 1
        return self.recodes[self.ptr]

    def isBegin(self):
        return self.ptr == 0

    def isDeadline(self):
        return self.ptr == len(self.recodes) - 1


<mask token>

class RecodeStack:
    <mask token>
    <mask token>

    def __init__(self):
        super(RecodeStack, self).__init__()

    def insert(self, pageIndex, tag=None):
        self.ptr += 1
        del self.recodes[self.ptr:len(self.recodes)]
        self.recodes.insert(self.ptr, [pageIndex, tag])

    def backward(self):
        self.ptr -= 1
        return self.recodes[self.ptr]

    def forward(self):
        self.ptr += 1
        return self.recodes[self.ptr]

    def isBegin(self):
        return self.ptr == 0

    def isDeadline(self):
        return self.ptr == len(self.recodes) - 1


<mask token>

class RecodeStack:
    recodes = []
    ptr = -1

    def __init__(self):
        super(RecodeStack, self).__init__()

    def insert(self, pageIndex, tag=None):
        self.ptr += 1
        del self.recodes[self.ptr:len(self.recodes)]
        self.recodes.insert(self.ptr, [pageIndex, tag])

    def backward(self):
        self.ptr -= 1
        return self.recodes[self.ptr]

    def forward(self):
        self.ptr += 1
        return self.recodes[self.ptr]

    def isBegin(self):
        return self.ptr == 0

    def isDeadline(self):
        return self.ptr == len(self.recodes) - 1


recodeStack = RecodeStack()

class RecodeStack:
    recodes = []
    ptr = -1

    def __init__(self):
        super(RecodeStack, self).__init__()

    # pageIndex 页面下标
    # tag 附信息
    def insert(self, pageIndex, tag=None):
        self.ptr += 1
        del self.recodes[self.ptr:len(self.recodes)]
        self.recodes.insert(self.ptr, [pageIndex, tag])

    def backward(self):
        self.ptr -= 1
        return self.recodes[self.ptr]

    def forward(self):
        self.ptr += 1
        return self.recodes[self.ptr]

    def isBegin(self):
        return self.ptr == 0

    def isDeadline(self):
        return self.ptr == len(self.recodes) - 1


recodeStack = RecodeStack()
