class NodeList{
int val;
NodeList next ,prev
NodeList(int val ){
this.val=val;
next=prev=null;
}
public NodeList inverse(NodeList head){
ListNode temp = new NodeList();
while(head.next!=null){
temp = head;
head=head.next;
temp.prev=temp.next;
prev=head;
}
}
}