from dataclasses import dataclass
from __future__ import annotations
from typing import Any


@dataclass
class Node:
    key: Any
    next: Node


class LinkedList:

    def __init__(self, node: Node):
        self.head = node
        self.tail = node

    def insert(self, node: Node):
        node.next = self.head
        self.head = node
        self.tail.next = node

    def search(self, value: Any):
        node = self.head
        while node.key != value:
            node = node.next
            if node == self.tail:
                break
        return node

f2a606e2b13140cef997627e382e568ba75f1ac0
<mask token>


class LinkedList:
    <mask token>
    <mask token>

    def search(self, value: Any):
        node = self.head
        while node.key != value:
            node = node.next
            if node == self.tail:
                break
        return node

<mask token>


class LinkedList:
    <mask token>

    def insert(self, node: Node):
        node.next = self.head
        self.head = node
        self.tail.next = node

    def search(self, value: Any):
        node = self.head
        while node.key != value:
            node = node.next
            if node == self.tail:
                break
        return node

<mask token>


@dataclass
class Node:
    key: Any
    next: Node


class LinkedList:

    def __init__(self, node: Node):
        self.head = node
        self.tail = node

    def insert(self, node: Node):
        node.next = self.head
        self.head = node
        self.tail.next = node

    def search(self, value: Any):
        node = self.head
        while node.key != value:
            node = node.next
            if node == self.tail:
                break
        return node

from dataclasses import dataclass
from __future__ import annotations
from typing import Any


@dataclass
class Node:
    key: Any
    next: Node


class LinkedList:

    def __init__(self, node: Node):
        self.head = node
        self.tail = node

    def insert(self, node: Node):
        node.next = self.head
        self.head = node
        self.tail.next = node

    def search(self, value: Any):
        node = self.head
        while node.key != value:
            node = node.next
            if node == self.tail:
                break
        return node
