#include <iostream>

using namespace std;

struct ListNode {
  int m_nValue;
  ListNode* m_pNext;
};


ListNode* MeetingNode(ListNode *pHead) {
  if(pHead==NULL)
    return NULL;

  ListNode *pSlow = pHead->m_pNext;
  if(pSlow==NULL)
    return NULL;

  ListNode *pFast = pSlow->m_pNext;
  while(pSlow!=NULL && pFast!=NULL) {
    if(pSlow==pFast)
      return pSlow;

    pSlow = pSlow->m_pNext;

    pFast = pFast->m_pNext;
    if(pFast!=NULL)
      pFast = pFast->m_pNext;
  }

  return NULL;
}


ListNode* EntryNode(ListNode *pHead) {
  ListNode *pMeeting = MeetingNode(pHead);
  if(pMeeting==NULL)
    return NULL;

  ListNode *pNode1 = pMeeting;
  int nLoopNode = 1;
  while(pNode1->m_pNext!=pMeeting) {
    pNode1 = pNode1->m_pNext;
    nLoopNode++;
  }

  pNode1 = pHead;
  ListNode *pNode2 = pHead;
  for(int i=0; i<nLoopNode; i++)
    pNode1 = pNode1->m_pNext;

  while(pNode2!=pNode1) {
    pNode2 = pNode2->m_pNext;
    pNode1 = pNode2->m_pNext;
  }

  return pNode1;

}


int main(int argc, char **argv) {

  return 0;
}

