def vienna_output(seq, pairs, header_lines=None, removed=None):
    """Return sequence and structure information in vienna format

    seq -- string of sequence characters, no validation
    pairs -- Pairs object or list of tuples
    header_lines -- list of header lines at the top of the file

    Return value is a formatted string:
    > header information
    sequence
    vienna structure
    """
    result = []
    if not header_lines:
        head = '> Nested structure'
    else:
        head = '> ' + header_lines[0].strip()
    result.append(head)
    result.append(seq)
    result.append(pairs.toVienna(len(seq)))
    if removed is not None:
        result.append('>REMOVED BASE PAIRS FOR: %s' % head)
        try:
            result.append(removed.toVienna(len(seq)))
        except:
            result.append(str(removed))
    return '\n'.join(result)
