//* Problem  : 1224 - HTML
//* Contest  : acm.tju.edu.cn
//* Origin   : University of Ulm Local Contest 1999
//* Type     : Solution
//* Date     : 2008.06.06
//* Author   : alt
//* Language : C++
//* Compiler : Microsoft Visual C++ 8.0

#include <stdio.h>
#include <math.h>
#include <string.h>
#include <stdlib.h>

#include <algorithm>
#include <vector>
#include <queue>
#include <map>
#include <string>
#include <iostream>
using namespace std;
#define int64 long long
#define INF 1000000000
#define EPS 1E-8

#define ALL(a) a.begin(), a.end()
#define PB(a, v) a.push_back(v)
#define MP(a,b) make_pair(a, b)
#define FOR(i, n) for (int i = 0; i < (int)(n); i++)
#define FORO(i, obj) for (int i = 0; i < (int)(obj.size); i++)

char s[1000];

int scan()
{
	s[0] = 0;
	return scanf("%s", s) == 1;
}

int main()
{
#ifdef _DEBUG
	freopen("1166.in", "r", stdin);
	freopen("1166.out", "w", stdout);
#endif
	int n = 0, m;
	while (1)
	{
		if (!scan()) break; m = strlen(s);
		if (!strcmp(s, "<br>"))
		{
			putchar('\n'); n = 0;
		}
		else if (!strcmp(s, "<hr>"))
		{
			if (n) putchar('\n');
			for (int i = 0; i < 80; i++)
				putchar('-'); putchar('\n');
			n = 0;
		}
		else if (n + m + !!n <= 80)
		{
			if (n) putchar(' ');
			printf("%s", s); n += m + !!n;
		}
		else
		{
			putchar('\n');
			printf("%s", s); n = m;
		}

	}
	if (n) putchar('\n');
	return 0;
}
