#include <iostream>
#include <algorithm>

using namespace std;

int main()
{
    int neededWidth;
    string text;
    cin >> neededWidth;
    cin.ignore();
    getline(cin, text);
    neededWidth += 2;
    int numberOfSpaces = count(text.begin(), text.end(), ' ');
    int missingSpaces = neededWidth - text.size();
    string result;
    for(auto c : text)
    {
        result += c;
        if(c == ' ')
        {
            int numberOfSpacesToAppend = (missingSpaces-1)/numberOfSpaces+1;
            result.append(numberOfSpacesToAppend, ' ');
            missingSpaces -= numberOfSpacesToAppend;
            --numberOfSpaces;
        }
    };
    cout << result;
    return 0;
}
