public static ListNode mergeTwoList(ListNode left, ListNode right) {
        ListNode safeNode = new ListNode(Integer.MAX_VALUE);
        ListNode p = safeNode;

        while (left != null && right != null) {
            if (left.val <= right.val) {
                p.next = left;
                left = left.next;
            } else {
                p.next = right;
                right = right.next;
            }
            
            p = p.next;
        }

        if (left != null) {
            p.next = left;
        }

        if (right != null) {
            p.next = right;
        }

        return safeNode.next;
    }