#include <iostream>
using namespace std;

struct Node{
    int data;
    Node* pNext;
};

void insertOrderedList(Node* &pHead, int x) {
    if(pHead == nullptr || pHead->data > x) {
        Node* tmp = new Node;
        tmp->data = x;
        tmp->pNext = pHead;
        pHead = tmp;
        return;
    }

    Node* cur = pHead;
    while(cur->pNext!=nullptr) {
        if(cur->pNext->data > x) {
            Node* tmp = new Node;
            tmp->data = x;
            tmp->pNext = cur->pNext;
            cur->pNext = tmp;
            return;
        }
        cur = cur->pNext;
    }

    Node* tmp = new Node;
    tmp->data = x;
    tmp->pNext = cur->pNext;
    cur->pNext = tmp;
}

int main() {}