def process_items(items):
    """Create a multi-level itemize list."""
    last, items = items
    start, end = '\\begin{itemize}', '\\end{itemize}'
    result = start
    stack = [end]
    for ident, item in items:
        if ident < last:
            result += stack.pop()
            last = ident
        elif ident > last:
            stack.append(end)
            result += start
            last = ident
        result += '\\item {}'.format(item)
    while stack:
        result += stack.pop()
    return result
