/**
* Definition for singly-linked list.
* public class ListNode {
* int val;
* ListNode next;
* ListNode(int x) { val = x; }
* }
*/
class Solution {
public ListNode swapPairs(ListNode head) {
if(head==null||head.next==null)
return head;
ListNode ans=head.next;
ListNode temp=swapPairs(head.next.next);
ans.next=head;
head.next=temp;
return ans;
}
}