#include<cstdio>
#include<cstring>
#include<string>
int Ile(int & a, int & b, int l, std::string sb[], char * tab)
{
if (strlen(tab) < 4)
{
sb[0] = tab;
return 1;
}
if (l % 3 == 0)
{
a = l / 3;
b = 0;
}
else if (l % 3 == 1)
{
a = (l / 3) - 1;
b = 2;
}
else
{
a = l / 3;
b = 1;
}
int h = 0, k = 0;
for (int i = 0; i < a; i++)
{
for (int j = 0; j < 3; j++)
sb[h] += tab[k++];
h++;
}
for (int i = 0; i < b; i++)
{
for (int j = 0; j < 2; j++)
sb[h] += tab[k++];
h++;
}
return h;
}
int main()
{
int n; scanf("%d", &n);
char tab[1001];
int k = 0;
while (scanf("%s", tab) > 0)
{
std::string sb[1000] = {""};
int l = strlen(tab);
int ile3, ile2;
int h = Ile(ile3, ile2, l, sb, tab);
//printf("%d\n", h);
for (int i = 0; i < h; i++)
{
if (i == 0 && k > 0)
{
printf(" ");
k++;
}
k += sb[i].length();
//printf("%d\n", k);
if (k >= n)
{
if (i == 0)
{
printf("\n%s", sb[i].c_str());
k = sb[i].length();
}
else if (k == n && i == h - 1)
{
printf("%s\n", sb[i].c_str());
k = 0;
}
else
{
printf("-\n%s", sb[i].c_str());
k = sb[i].length();
}
}
else
{
printf("%s", sb[i].c_str());
}
}
}
return 0;
}
I2luY2x1ZGU8Y3N0ZGlvPgojaW5jbHVkZTxjc3RyaW5nPgojaW5jbHVkZTxzdHJpbmc+CgppbnQgSWxlKGludCAmIGEsIGludCAmIGIsIGludCBsLCBzdGQ6OnN0cmluZyBzYltdLCBjaGFyICogdGFiKQp7CglpZiAoc3RybGVuKHRhYikgPCA0KQoJewoJCXNiWzBdID0gdGFiOwoJCXJldHVybiAxOwoJfQoKCWlmIChsICUgMyA9PSAwKQoJewoJCWEgPSBsIC8gMzsKCQliID0gMDsKCX0KCWVsc2UgaWYgKGwgJSAzID09IDEpCgl7CgkJYSA9IChsIC8gMykgLSAxOwoJCWIgPSAyOwoJfQoJZWxzZQoJewoJCWEgPSBsIC8gMzs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