class Node():
    """
    Class to create a new node.
    """
    def __init__(self, data):
        """
        Initializes an instance of a node with a *data* attribute value equal to *data*.
        """
        self.data = data
        self._next = None


class Stack():
    """
    Method to generate and modify a stack.
    """

    top = None

    def push(self, new_data):
        """
        Method to add a new node at the top of a stack with a *data* attribute value equal to *new_data*.
        Returns *data* value.
        """
        new_node = Node(new_data)
        if self.top is None:
            self.top = new_node
        else:
            new_node._next = self.top
            self.top = new_node
        return self.top.data

    def pop(self):
        """
        Method to remove the top node from a stack and return the value of its *data* attribute.
        """
        if self.top is not None:
            current = self.top
            self.top = self.top._next
            current._next = None
            return current.data
        else:
            return None

    def peek(self):
        """
        Method to return the value of the *data* attribute from the top node of a stack.
        """
        if self.top is not None:
            return self.top.data
        else:
            return None


def multi_bracket_validation(string):
    """
    Function to check the input string for matched bracket sets '{}', '[]', and '()'.
    If there is a closing bracket for each opening bracket, it will return True.
    If there is no matching closing bracket for any opening bracket, it will return False.
    If there is no matching opening bracket for any closing bracket, it will return False.
    """
    stack = Stack()

    for char in string:
        if char == '{' or char == '[' or char == '(':
            stack.push(char)
        if char == '}':
            if stack.peek() == '{':
                stack.pop()
            else:
                return False
        if char == ']':
            if stack.peek() == '[':
                stack.pop()
            else:
                return False
        if char == ')':
            if stack.peek() == '(':
                stack.pop()
            else:
                return False
    if stack.peek() is None:
        return True
    return False

class Node():
    """
    Class to create a new node.
    """
    def __init__(self, data):
        """
        Initializes an instance of a node with a *data* attribute value equal to *data*.
        """
        self.data = data
        self._next = None


class Stack():
    """
    Method to generate and modify a stack.
    """

    top = None

    def push(self, new_data):
        """
        Method to add a new node at the top of a stack with a *data* attribute value equal to *new_data*.
        Returns *data* value.
        """
        new_node = Node(new_data)
        if self.top is None:
            self.top = new_node
        else:
            new_node._next = self.top
            self.top = new_node
        return self.top.data

    def pop(self):
        """
        Method to remove the top node from a stack and return the value of its *data* attribute.
        """
        if self.top is not None:
            current = self.top
            self.top = self.top._next
            current._next = None
            return current.data
        else:
            return None

    def peek(self):
        """
        Method to return the value of the *data* attribute from the top node of a stack.
        """
        if self.top is not None:
            return self.top.data
        else:
            return None


def multi_bracket_validation(string):
    """
    Function to check the input string for matched bracket sets '{}', '[]', and '()'.
    If there is a closing bracket for each opening bracket, it will return True.
    If there is no matching closing bracket for any opening bracket, it will return False.
    If there is no matching opening bracket for any closing bracket, it will return False.
    """
    stack = Stack()

    for char in string:
        if char == '{' or char == '[' or char == '(':
            stack.push(char)
        if char == '}':
            if stack.peek() == '{':
                stack.pop()
            else:
                return False
        if char == ']':
            if stack.peek() == '[':
                stack.pop()
            else:
                return False
        if char == ')':
            if stack.peek() == '(':
                stack.pop()
            else:
                return False
    if stack.peek() is None:
        return True
    return False

Class to create a new node. Initializes an instance of a node with a *data* attribute value equal to *data*. Method to generate and modify a stack. Method to add a new node at the top of a stack with a *data* attribute value equal to *new_data*.         Returns *data* value. Method to remove the top node from a stack and return the value of its *data* attribute. Method to return the value of the *data* attribute from the top node of a stack. Function to check the input string for matched bracket sets '{}', '[]', and '()'.     If there is a closing bracket for each opening bracket, it will return True.     If there is no matching closing bracket for any opening bracket, it will return False.     If there is no matching opening bracket for any closing bracket, it will return False.