#!/usr/bin/env python3
#
# ---
# source: https://git.pokorny.ca/dotfiles

"""Wrap text at 79 columns."""

import sys
from textwrap import wrap

COLUMN_WIDTH = 79


def next_line():
    _l = sys.stdin.readline()
    if not _l:
        sys.exit(0)
    return _l


def wrap_line(_l):
    parts = wrap(_l, COLUMN_WIDTH, break_long_words=False, break_on_hyphens=False)
    return "\n".join(parts)


def main():

    # Skip headers
    _l = next_line()
    while _l.strip():
        sys.stdout.write(_l)
        _l = next_line()

    sys.stdout.write("\n")

    for _l in sys.stdin.readlines():
        if _l.startswith(">"):
            sys.stdout.write(_l)
        else:
            sys.stdout.write(wrap_line(_l))
            sys.stdout.write("\n")


if __name__ == "__main__":
    main()
