#!/usr/bin/python3

# take fasta input, and remove newlines in the middle of sequences

import sys

if len(sys.argv) > 1:
    f = open(sys.argv[1])
else:
    f = sys.stdin

first = True
for line in f:
    if line[0] == '>':
        if not first: print()
        print(line)
    else:
        end = len(line)-1
        if end > 0 and line[end] == '\n': end -= 1
        print(line[:end], end='')
    first = False

f.close()