class Stack:

    def __init__(self, size=None):
        self.size = float('Inf') if size is None else size
        self._list = []

    def add(self, elem):
        if len(self._list) >= self.size:
            print("Error 'add'")
        else:
            self._list.append(elem)

    def pop(self):
        if not self._list:
            print("Error 'pop'")
        else:
            return self._list.pop(-1)

    def size(self):
        return len(self._list)

    def to_string(self):
        for item in self._list[::-1]:
            print('| ', str(item).center(5, ' '), ' |')
        print('_' * 9)

f4528b90660fdc7d8634430dbe2289a4644dcfd5
class Stack:
    <mask token>
    <mask token>
    <mask token>

    def size(self):
        return len(self._list)

    def to_string(self):
        for item in self._list[::-1]:
            print('| ', str(item).center(5, ' '), ' |')
        print('_' * 9)

class Stack:
    <mask token>

    def add(self, elem):
        if len(self._list) >= self.size:
            print("Error 'add'")
        else:
            self._list.append(elem)
    <mask token>

    def size(self):
        return len(self._list)

    def to_string(self):
        for item in self._list[::-1]:
            print('| ', str(item).center(5, ' '), ' |')
        print('_' * 9)

class Stack:

    def __init__(self, size=None):
        self.size = float('Inf') if size is None else size
        self._list = []

    def add(self, elem):
        if len(self._list) >= self.size:
            print("Error 'add'")
        else:
            self._list.append(elem)
    <mask token>

    def size(self):
        return len(self._list)

    def to_string(self):
        for item in self._list[::-1]:
            print('| ', str(item).center(5, ' '), ' |')
        print('_' * 9)

class Stack:

    def __init__(self, size=None):
        self.size = float('Inf') if size is None else size
        self._list = []

    def add(self, elem):
        if len(self._list) >= self.size:
            print("Error 'add'")
        else:
            self._list.append(elem)

    def pop(self):
        if not self._list:
            print("Error 'pop'")
        else:
            return self._list.pop(-1)

    def size(self):
        return len(self._list)

    def to_string(self):
        for item in self._list[::-1]:
            print('| ', str(item).center(5, ' '), ' |')
        print('_' * 9)
