import textwrap
def wrap(s, n):
    return "\n".join(textwrap.wrap(s, n))
assert wrap("a b c d", 3) == "a b\nc d"
print("SELF-TEST PASS")