#class ListNode(object):
# def __init__(self, x):
# self.val = x
# self.next = None
curr = head
while curr.next != None:
tmp = curr.next
curr.next = tmp.next
tmp.next = head.next
head.next = tmp
#class ListNode(object):
# def __init__(self, x):
# self.val = x
# self.next = None
curr = head
while curr.next != None:
tmp = curr.next
curr.next = tmp.next
tmp.next = head.next
head.next = tmp