josephus problem using circular linked lists