// ????.cpp : Defines the entry point for the console application.
// ????:????
int main()
{
	int n;                                                        //????n???????
	char words[1000][42];                                         //?????????words?????
	char (*p)[42];                                                //???????p???????????
	int sum=0,len1=0,len2=0;                                      //????sum????????????len1?len2????????????
	cin>>n;                                                       //???????
	for(int i=0;i<n;i++)                                          //????????
	{
		scanf("%s",words[i]);
	}
	p=words;                     //?p??????
	int i=0;                     //??????i??????
	while(sum<=80&&i<n)               //????????????80???????????
	{
		len1=strlen(words[i]);      //???i??????
		len2=strlen(words[i+1]);           //???i+1??????
		if((sum+len1)<=80&&(sum+len1+1+len2)>80)           //?????i?????????i+1???
		{
			cout<<*p<<endl;                     //??i????????
			p++;                                //?????????
			i++;                                //i????
			sum=0;                                    //sum???0
		}
		else if((sum+len1)<80&&(sum+len1+1+len2)<=80)     //?????i?????????????
		{
			if(i!=n-1)                  //??????????
			{
				cout<<*p<<" ";            //??????????
			    p++;                       //p???????
			    sum=sum+len1+1;             //?????sum+1
			    i++;                       //i??
			}
			else                      //?????????????????
			{
				cout<<*p;
				break;
			}
		}
	}
	return 0;
}
	