class Solution:
def reverseList(self,head):
if head == None:
return None
L,M,R = None,None,head
while R.next != None:
L = M
M = R
R = R.next
M.next = L
R.next = M
return R