// Following is the node structure
/**************
class ListNode{
	public:
	int data;
	ListNode* next;
};

ListNode* newListNode(int data){
	ListNode *temp = new ListNode;
    	temp->data = data;
    	temp->next = NULL;
    	return temp;
}
***************/

ListNode* RemoveNodeWithGreaterLeft(ListNode *head) {
	/*Write your code here. 
	*Don't write main().
	*Don't take input, it is passed as function argument.
	*Don't print output.
	*Taking input and printing output is handled automatically.
	*/
    
    if(head == NULL){
        return NULL;
    }
    if(head->next == NULL){
        return head;
    }
    ListNode *temp = head;
    ListNode *prev = NULL;
	while(temp->next!=NULL){
        prev = temp;
        temp = temp->next;
        if(prev->data > temp->data){
            prev->next = temp->next;
        }
       
    }
    return head;
}