LearnPy Hub
← Arena
IntermediateRating 1300

Wrap the Text

Wrap a paragraph to lines of at most w characters, breaking only between words (a word longer than w goes on its own line). Print the lines.

Input

w, then one line of text.

Output

Lines.

Sample 1

Input
10
the quick brown fox jumps over the lazy dog
Output
the quick
brown fox
jumps over
the lazy
dog

Sample 2

Input
3
abcdef gh
Output
abcdef
gh
solution.py
Output appears here
Wrap the Text · Python Arena problem · LearnPy Hub