def wrap_by_word(s, n):
    """
    Returns a string where \n is inserted between every n words

    :param s: string
    :param n: integer, number of words
    :return:
    """
    a                   = s.split()
    ret                 = ''
    for i in range(0, len(a), n):
        ret += ' '.join(a[i:i+n]) + '\n'
    return ret