class ListNode:
    def __init__(self, value=0, next=None):
        self.value = value
        self.next = next

def delete_duplicates(head: ListNode) -> ListNode:
    current = head
    while current and current.next:
        if current.value == current.next.value:
            # تخطي العقدة المكررة
            current.next = current.next.next
        else:
            current = current.next
    return head

def create_linked_list(values):
    head = None
    current = None
    for value in values:
        new_node = ListNode(value)
        if not head:
            head = new_node
            current = head
        else:
            current.next = new_node
            current = current.next
    return head

def print_linked_list(node: ListNode):
    while node:
        print(node.value, end=" -> ")
        node = node.next
    print("None")

# الحصول على إدخال المستخدم
input_values = input("أدخل القيم للقائمة المرتبطة (مفصولة بفواصل): ")
values = list(map(int, input_values.split(',')))

# إنشاء القائمة المرتبطة من الإدخال
head = create_linked_list(values)

# إزالة التكرارات
new_head = delete_duplicates(head)

# طباعة القائمة بعد إزالة التكرارات
print("القائمة بعد إزالة التكرارات:")
print_linked_list(new_head)