# -*- coding:utf-8 -*-
# class ListNode:
#     def __init__(self, x):
#         self.val = x
#         self.next = None
class Solution:
    def EntryNodeOfLoop(self, pHead):
        # write code here
        s = set() # 利用set容器去做
        cur = pHead
        while cur:
            if cur in s:
                return cur
            else:
                s.add(cur)
                cur = cur.next
        return None