Anfisa the monkey learns to type. She is yet unfamiliar with the "space" key and can only type in lower-case Latin letters. Having typed for a fairly long line, Anfisa understood that it would be great to divide what she has written into *k* lines not shorter than *a* and not longer than *b*, for the text to resemble human speech more. Help Anfisa.
The first line contains three integers *k*, *a* and *b* (1 ≤ *k* ≤ 200, 1 ≤ *a* ≤ *b* ≤ 200). The second line contains a sequence of lowercase Latin letters — the text typed by Anfisa. It is guaranteed that the given line is not empty and its length does not exceed 200 symbols.
from collections import Counter, defaultdict, deque
from bisect import bisect_left, bisect_right
from heapq import heapify, heappush, heappop


def solve():
    k, a, b = map(int, input().split())
    s = input()
    n = len(s)
    ans = []

    dp = [[-1 for _ in range(k + 1)] for __ in range(n + 1)]

    def recurr(i, j, soFar):
        nonlocal ans
        if j == k and i == n:
            ans = soFar.copy()
            return 1
        if j == 3:
            return 0
        if i == n:
            return 0
        if dp[i][j] != -1:
            return dp[i][j]
        here = ""
        if (i + a) >= n:
            return 0
        for l in range(i, min(n, i + a - 1)):
            here += s[l]
        lcl = 0
        for l in range(min(n - 1, i + a - 1), min(n, i + b)):
            here += s[l]
            soFar.append(here)
            lcl |= recurr(l + 1, j + 1, soFar.copy())
            soFar.pop()
        dp[i][j] = lcl
        return dp[i][j]

    ret = recurr(0, 0, [])
    if ret:
        for sub in ans:
            print(sub)
    else:
        print("No solution")


solve()
