def listupper(t):
    """
    Capitalizes all strings in nested lists.
    """
    if isinstance(t, list):
        return [listupper(s) for s in t]
    elif isinstance(t, str):
        return t.upper()
    else:
        return t