#!/usr/bin/env python3

from os import read, write
from sys import argv
from re import compile

STDIN, STDOUT = 0, 1
BUFSIZE = 8
LINE_RE = compile(b'(\\n)')

if __name__ == '__main__':
    while True:
        buf = read(STDIN, BUFSIZE)
        if not buf: break
        for line in LINE_RE.split(buf):
            if LINE_RE.fullmatch(line):
                write(STDOUT, b' ')
                write(STDOUT, argv[1].encode())
            write(STDOUT, line)
