//1099HTML
#include <iostream>
#include <stdio.h>
#include <string>
#define FILE_DEBUG
#ifdef FILE_DEBUG
#include <fstream>
#endif
using namespace std;
int main(int argc, char *argv[])
{
#ifdef FILE_DEBUG
ifstream fin;
fin.open("input.txt");
cin.rdbuf(fin.rdbuf()); // assign file's streambuf to cin
#ifdef _C_LAN_
freopen("input.txt", "r", stdin);
#endif
#endif
#ifdef FILE_DEBUG
ofstream fout;
fout.open("output.txt");
cout.rdbuf(fout.rdbuf()); // assign file's streambuf to cout
#ifdef _C_LAN_
freopen("output.txt", "w", stdout);
#endif
#endif
int count = 0;
string str_in;
while (cin >> str_in)
{
if (str_in == "<br>")
{
cout << endl;
count = 0;
}
else if (str_in == "<hr>")
{
if (count > 0)
{
cout << endl;
}
for (int i = 0; i < 80; i ++)
{
cout << '-';
}
cout << endl;
count = 0;
}
else
{
if (count + str_in.size() + 1 <= 80)
{
if (count > 0)
{
cout << " ";
count ++;
}
cout << str_in;
count += str_in.size();
}
else
{
cout << endl << str_in;
count = str_in.size();
}
}
//cout << "(end is_nl: " << is_nl << ")";
}
cout << endl;
return 0;
}