You are given the string s of length n and the numbers p, q. Split the string s to pieces of length p and q.

For example, the string "Hello" for p = 2, q = 3 can be split to the two strings "Hel" and "lo" or to the two strings "He" and "llo".

Note it is allowed to split the string s to the strings only of length p or to the strings only of length q (see the second sample test).


-----Input-----

The first line contains three positive integers n, p, q (1 ≤ p, q ≤ n ≤ 100).

The second line contains the string s consists of lowercase and uppercase latin letters and digits.


-----Output-----

If it's impossible to split the string s to the strings of length p and q print the only number "-1".

Otherwise in the first line print integer k — the number of strings in partition of s.

Each of the next k lines should contain the strings in partition. Each string should be of the length p or q. The string should be in order of their appearing in string s — from left to right.

If there are several solutions print any of them.


-----Examples-----
Input
5 2 3
Hello

Output
2
He
llo

Input
10 9 5
Codeforces

Output
2
Codef
orces

Input
6 4 5
Privet

Output
-1

Input
8 1 1
abacabac

Output
8
a
b
a
c
a
b
a
c

Difficulty: EASY

Solutions:
(n, a, b) = list(map(int, input().split(' ')))
s = input()
c = 0
while c * a <= n and (n - c * a) % b != 0:
	c += 1
if c * a > n:
	print(-1)
else:
	cb = (n - a * c) // b
	print(c + cb)
	for i in range(c):
		print(s[a * i:a * (i + 1)])
	for i in range(cb):
		print(s[c * a + b * i:c * a + b * (i + 1)])


(n, p, q) = [int(j) for j in input().split()]
s = str(input())
(x, y) = (-1, -1)
found = False
for j in range(101):
	for k in range(101):
		res = j * p + k * q
		if res == n:
			(x, y) = (j, k)
			found = True
			break
		elif res > n:
			break
	if found == True or j * p > n:
		break
if found == False:
	print(-1)
else:
	(p1, p2) = (0, p)
	List = []
	for j in range(x):
		List.append(s[p1:p2])
		p1 += p
		p2 += p
	p2 = p1 + q
	for j in range(y):
		List.append(s[p1:p2])
		p1 += q
		p2 += q
	print(len(List))
	for j in range(len(List)):
		print(List[j])


(n, p, q) = map(int, input().split())
s = input()
for i in range(n + 1):
	for j in range(n + 1):
		if i * p + j * q == n:
			print(i + j)
			for ii in range(i):
				print(s[ii * p:(ii + 1) * p])
			for jj in range(j):
				print(s[i * p + jj * q:i * p + (jj + 1) * q])
			exit()
print('-1')


(n, p, q) = map(int, input().split())
s = input()
subs = []
temp = s
while n > 0 and p <= n:
	if n % q == 0:
		break
	subs.append(s[:p])
	s = s[p:]
	n = len(s)
while n > 0 and q <= n:
	subs.append(s[:q])
	s = s[q:]
	n = len(s)
if n == 0:
	print(len(subs))
	for i in range(len(subs)):
		print(subs[i])
else:
	print('-1')


(n, p, q) = map(int, input().split())
s = input()
f = 0
for i in range(0, 101):
	for j in range(0, 101):
		if p * i + q * j == n:
			f = 1
			print(i + j)
			P = 0
			for x in range(p, p * i + 1, p):
				print(s[P:x])
				P = x
			for x in range(q + P, n + 1, q):
				print(s[P:x])
				P = x
			break
	if f:
		break
if f ^ 1:
	print(-1)


(n, p, q) = list(map(int, input().split()))
s = input()
m = 0
while m * p <= n:
	if (n - m * p) % q == 0:
		k = m + (n - m * p) // q
		print(k)
		for i in range(m):
			print(s[p * i:p * (i + 1)])
		for i in range(k - m):
			print(s[p * m + q * i:p * m + q * (i + 1)])
		break
	m += 1
else:
	print(-1)


R = lambda : map(int, input().split())
(n, p, q) = R()
s = input()
for a in range(n // p + 1):
	r = n - p * a
	if r % q == 0:
		b = r // q
		print(a + b)
		for i in range(a):
			print(s[p * i:p * i + p])
		for i in range(b):
			print(s[p * a + q * i:p * a + q * i + q])
		exit()
print(-1)


(n, p, q) = map(int, input().split())
s = input()
verbose = False
dp = 0
dq = 0
for i in range(n // p + 1):
	if (n - p * i) % q == 0:
		dp = i
		dq = round((n - p * i) / q)
		verbose = True
		break
if verbose == False:
	print(-1)
else:
	print(dp + dq)
	for i in range(0, dp * p, p):
		print(s[i:i + p])
	for i in range(p * dp, len(s), q):
		print(s[i:i + q])


(n, p, q) = map(int, input().split())
s = input()
k1 = 0
k = 0
r = n // p
for i in range(r, -1, -1):
	if (n - p * i) % q == 0:
		k1 = i
		k = k1 + (n - p * i) // q
if k == 0:
	print(-1)
else:
	print(k)
	for i in range(k1):
		print(s[i * p:(i + 1) * p])
	for i in range(k - k1):
		print(s[p * k1 + i * q:p * k1 + (i + 1) * q])


def STR():
	return list(input())

def INT():
	return int(input())

def MAP():
	return map(int, input().split())

def MAP2():
	return map(float, input().split())

def LIST():
	return list(map(int, input().split()))

def STRING():
	return input()
import string
import sys
from heapq import heappop, heappush
from bisect import *
from collections import deque, Counter, defaultdict
from math import *
from itertools import permutations, accumulate
dx = [-1, 1, 0, 0]
dy = [0, 0, 1, -1]
(n, p, q) = MAP()
s = STR()
ans = []
(r1, r2) = (0, 0)
for i in range(n + 1):
	x1 = i * p
	x2 = n - x1
	x3 = x2 % q
	if x3 == 0:
		r1 = i
		r2 = x2 // q
		break
if r1 == r2 == 0 or r1 < 0 or r2 < 0:
	print('-1')
	exit(0)
(x, y) = (r1, r2)
v1 = ''
for i in range(0, r1 * p):
	v1 += s[i]
	if len(v1) == p:
		ans.append(v1)
		v1 = ''
v2 = ''
for i in range(r1 * p, n):
	v2 += s[i]
	if len(v2) == q:
		ans.append(v2)
		v2 = ''
if len(ans) == r1 + r2:
	print(len(ans))
	for i in ans:
		print(i)
else:
	print('-1')


(n, p, q) = map(int, input().split())
s = input()
flag = False
for i in range(100):
	for j in range(100):
		if i * p + j * q == n:
			store = (i, j)
			flag = True
			break
	if flag:
		break
if not flag:
	print(-1)
else:
	print(i + j)
	x = 0
	for k in range(i):
		print(s[x:x + p])
		x += p
	for k in range(j):
		print(s[x:x + q])
		x += q


def f(n, p, q):
	mp = n // p
	mq = n // q
	for i in range(mp + 1):
		for j in range(mq + 1):
			if i * p + j * q == n:
				return (i, j)
	return (-1, -1)
(n, p, q) = list(map(int, input().strip().split()))
s = str(input())
(i, j) = f(n, p, q)
if i == -1 and j == -1:
	print(-1)
else:
	print(i + j)
	for a in range(i):
		print(s[a * p:(a + 1) * p])
	for b in range(j):
		print(s[b * q + i * p:(b + 1) * q + i * p])


(n, p, q) = input().split()
n = int(n)
p = int(p)
q = int(q)
s = input()
for i in range(101):
	for j in range(101):
		if i * p + j * q == n:
			print(i + j)
			for a in range(i):
				print(s[a * p:(a + 1) * p])
			for b in range(j):
				print(s[i * p + b * q:i * p + (b + 1) * q])
			exit()
print('-1')


import bisect
from itertools import accumulate
import os
import sys
import math
from decimal import *
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))

def input():
	return sys.stdin.readline().rstrip('\r\n')

def isPrime(n):
	if n <= 1:
		return False
	if n <= 3:
		return True
	if n % 2 == 0 or n % 3 == 0:
		return False
	i = 5
	while i * i <= n:
		if n % i == 0 or n % (i + 2) == 0:
			return False
		i = i + 6
	return True
(n, p, q) = map(int, input().split())
s = input()
for i in range(111):
	for j in range(111):
		if p * i + q * j == n:
			n = -1
			print(i + j)
			for l in range(i):
				print(s[:p])
				s = s[p:]
			for l in range(j):
				print(s[:q])
				s = s[q:]
if n != -1:
	print(-1)


(n, p, q) = map(int, input().split())
s = input()
x = 0
while p * x <= n:
	if (n - p * x) % q == 0:
		y = (n - p * x) // q
		print(x + y)
		l = 0
		while x > 0:
			x -= 1
			for i in range(p):
				print(s[l], end='')
				l += 1
			print()
		while y > 0:
			y -= 1
			for i in range(q):
				print(s[l], end='')
				l += 1
			print()
		exit(0)
	x += 1
print(-1)


(n, p, q) = map(int, input().split())
l = list(input())
for i in range(n // p + 1):
	co = 1
	for j in range(n // q + 1):
		if i * p + j * q == n:
			co = 0
			break
	if co == 0:
		break
else:
	print(-1)
	exit()
print(i + j)
for k in range(i):
	li = l[k * p:(k + 1) * p]
	print(*li, sep='')
	co = (k + 1) * p
for k in range(j):
	li = l[co + k * q:co + (k + 1) * q]
	print(*li, sep='')


def solve(n: int, p: int, q: int, s: str):
	for a in range(n // p + 1):
		if (n - a * p) % q == 0:
			b = (n - a * p) // q
			print(a + b)
			for pos in range(0, a * p, p):
				print(s[pos:pos + p])
			for pos in range(a * p, n, q):
				print(s[pos:pos + q])
			return
	print(-1)
(n, p, q) = map(int, input().split())
s = input()
solve(n, p, q, s)


def calc(n, p, q, s):
	for totalPCharacters in range(0, n + 1, p):
		if (n - totalPCharacters) % q == 0:
			pWords = int(totalPCharacters / p)
			qWords = int((n - p * pWords) / q)
			totalQCharacters = q * qWords
			print(pWords + qWords)
			for i in range(0, totalPCharacters, p):
				print(s[i:i + p])
			for i in range(totalPCharacters, n, q):
				print(s[i:i + q])
			return
	print(-1)
npq = [int(x) for x in input().split()]
s = input()
n = npq[0]
p = npq[1]
q = npq[2]
calc(n, p, q, s)


sn = list(map(int, input().split()))
n = sn[0]
p = sn[1]
q = sn[2]
s = input()
lim = 0
flag = False
flag2 = False
strings = []
while lim <= n:
	if (n - lim) % p == 0:
		flag = True
		break
	elif (n - lim) % q == 0:
		flag = True
		break
	lim += p
lim = 0
if flag:
	while (n - lim) % q != 0 and n - lim >= 0:
		strings.append(s[lim:lim + p])
		lim += p
	while n - lim >= 0:
		strings.append(s[lim:lim + q])
		lim += q
		flag2 = True
	if flag2:
		lim -= q
	else:
		lim -= p
	if n - lim != 0:
		print(-1)
	else:
		print(len(strings) - 1)
		for i in strings:
			print(i)
else:
	print(-1)


(n, p, q) = map(int, input().split())
s = input()
a = 0
b = 0
is_ok = False
while a * p <= n:
	if (n - a * p) % q == 0:
		b = (n - a * p) // q
		is_ok = True
		break
	a += 1
if is_ok:
	print(a + b)
	for i in range(a):
		print(s[i * p:i * p + p])
	p = p * a
	s = s[p:]
	for i in range(b):
		print(s[q * i:q * i + q])
else:
	print(-1)


import sys
fin = sys.stdin
(n, p, q) = map(int, fin.readline().split())
s = fin.readline().rstrip()
(kp, kq) = (None, None)
for i in range(0, n // p + 1):
	if not (n - i * p) % q:
		(kp, kq) = (i, (n - i * p) // q)
		break
else:
	print(-1)
	return
print(kp + kq)
(cpos, m) = (0, p * kp)
while cpos < m:
	print(s[cpos:cpos + p])
	cpos += p
while cpos < n:
	print(s[cpos:cpos + q])
	cpos += q


[n, a, b] = [int(n) for n in input().split(' ')]
w = input()
found = False
for i in range(0, int(n / a) + 1):
	if (n - a * i) % b == 0:
		found = True
		p = i
		q = int((n - a * i) / b)
		print(p + q)
		for j in range(0, p):
			print(w[a * j:a * (j + 1)])
		for k in range(0, q):
			print(w[a * p + b * k:a * p + b * (k + 1)])
		break
if not found:
	print(-1)


data = input().split()
(n, k, l) = [int(item) for item in data]
s = input()
j = -1
i = 0
while i * k <= n:
	if (n - k * i) % l == 0:
		j = (n - k * i) // l
		break
	i += 1
if j == -1:
	print(-1)
else:
	print(i + j)
	for idx in range(i):
		print(s[idx * k:(1 + idx) * k])
	for idx in range(j):
		print(s[k * i + idx * l:k * i + (1 + idx) * l])


def f(n, p, q, s):
	for i in range(n // p + 1):
		for j in range(n // q + 1):
			if i * p + j * q == n:
				print(i + j)
				for k in range(i):
					print(s[k * p:(k + 1) * p])
				for k in range(j):
					print(s[i * p + k * q:i * p + (k + 1) * q])
				return 1
	return -1
((n, p, q), s) = (map(int, input().strip().split()), input())
if -1 == f(n, p, q, s):
	print(-1)


import sys
if False:
	inp = open('A.txt', 'r')
else:
	inp = sys.stdin
(n, p, q) = map(int, inp.readline().split())
string = inp.readline().strip()
length = n
ans = -1
for i in range(n // p + 1):
	length = n - p * i
	if length % q == 0:
		ans = i
		break
if ans == -1:
	print(-1)
else:
	print(ans + length // q)
	for i in range(ans):
		print(string[:p])
		string = string[p:]
	for i in range(length // q):
		print(string[:q])
		string = string[q:]


(n, p, q) = list(map(int, input().split(' ')))
s = input()
c = -1
for i in range(n + 1):
	for j in range(n + 1):
		if p * i + q * j == n:
			c = i
			d = j
			break
	if c != -1:
		break
if c == -1:
	print(-1)
else:
	print(c + d)
	for i in range(c):
		print(s[p * i:p * (i + 1)])
	e = c * p
	for j in range(d):
		print(s[e + q * j:e + q * (j + 1)])


lectura = lambda : map(int, input().split())
(n, p, q) = lectura()
palabra = input()
prioridad = -1
prio2 = -1
for i in range(0, len(palabra) // p + 1):
	if (len(palabra) - p * i) % q == 0:
		prioridad = i
		prio2 = (len(palabra) - p * i) // q
		break
if prioridad == -1:
	print(-1)
else:
	print(prioridad + prio2)
	for i in range(0, prioridad):
		inicio = i * p
		final = (i + 1) * p
		print(palabra[inicio:final])
	for i in range(0, prio2):
		inicio = prioridad * p + i * q
		final = prioridad * p + (i + 1) * q
		print(palabra[inicio:final])


(n, m, k) = map(int, input().split())
ch = input()

def haha(n, p, q, s):
	for a in range(n // p + 1):
		if (n - a * p) % q == 0:
			b = (n - a * p) // q
			print(a + b)
			for pos in range(0, a * p, p):
				print(s[pos:pos + p])
			for pos in range(a * p, n, q):
				print(s[pos:pos + q])
			return
	print(-1)
haha(n, m, k, ch)


from collections import defaultdict

def main():
	(n, p, q) = map(int, input().split())
	s = input()
	exsited = set()
	for i in range(0, n + 1, p):
		rem = (n - i) % q
		if rem == 0:
			front = s[:i]
			back = s[i:]
			ss = [front[j:j + p] for j in range(0, i, p)] + [back[j:j + q] for j in range(0, n - i, q)]
			print(len(ss))
			print('\n'.join(ss))
			return
		if rem in exsited:
			break
		exsited.add(rem)
	print(-1)
main()


(n, p, q) = map(int, input().split())
string = input()
for i in range(101):
	for j in range(101):
		if p * i + q * j == n:
			print(i + j)
			for idx in range(i):
				print(string[idx * p:(idx + 1) * p])
			for idx in range(j):
				print(string[p * i + idx * q:p * i + (idx + 1) * q])
			exit(0)
print(-1)


(n, p, q) = map(int, input().split())
s = input()
for i in range(n // p + 1):
	for j in range(n // q + 1):
		if n == p * i + q * j:
			print(i + j)
			if i > 0:
				print('\n'.join((s[k * p:(k + 1) * p] for k in range(i))))
			if j > 0:
				print('\n'.join((s[p * i + k * q:p * i + (k + 1) * q] for k in range(j))))
			exit()
print(-1)


(n, p, q) = [int(e) for e in input().split(' ')]
s = input()
solA = -1
solB = -1
for i in range(0, n // p + 1):
	if (n - p * i) % q == 0:
		solA = i
		solB = (n - p * i) // q
		break
if solA == -1:
	print(-1)
else:
	print(solA + solB)
	for i in range(0, solA):
		print(s[i * p:(i + 1) * p])
	for i in range(0, solB):
		print(s[solA * p + i * q:solA * p + (i + 1) * q])


(a, b, c) = map(int, input().split(' '))
x = input()
for i in range(105):
	for j in range(105):
		if i * b + j * c == a:
			print(i + j)
			for k in range(i):
				print(x[:b])
				x = x[b:]
			for l in range(j):
				print(x[:c])
				x = x[c:]
			quit()
print(-1)


(n, p, q) = map(int, input().split())
str = input()
rp = n // p + 1
rq = n // q + 1
for i in range(rp):
	for j in range(rq):
		total = i * p + j * q
		if total == n:
			print(i + j)
			ult = 0
			for k in range(i):
				print(str[k * p:(k + 1) * p])
				ult = (k + 1) * p
			for k in range(j):
				print(str[k * q + ult:(k + 1) * q + ult])
			exit(0)
print('-1')


(n, xs, ys) = map(int, input().split())
s = input()
for x in range(n // xs + 1):
	if (n - x * xs) % ys == 0:
		y = (n - x * xs) // ys
		print(x + y)
		for i in range(x):
			print(s[i * xs:(i + 1) * xs])
		s = s[x * xs:len(s)]
		for j in range(y):
			print(s[j * ys:(j + 1) * ys])
		exit()
print(-1)


def fun(a, b, c, arr):
	x = 0
	y = 1
	while a - b * x > 0:
		y = (a - b * x) % c
		if y == 0:
			break
		x = x + 1
	y = (a - b * x) // c
	if x * b + y * c != a or x < 0 or y < 0:
		print(-1)
		return
	print(x + y)
	for i in range(0, x * b, b):
		for j in range(i, i + b):
			print(arr[j], end='')
		print()
	for i in range(b * x, a, c):
		for j in range(i, i + c):
			print(arr[j], end='')
		print()
(a, b, c) = [int(x) for x in input().split()]
arr = input()
fun(a, b, c, arr)


(a, b, c) = map(int, input().split())
z = input()
for i in range(0, 101, b):
	for j in range(0, 101, c):
		if i + j == a:
			print(i // b + j // c)
			f = 0
			k = i // b
			k1 = j // c
			i = 0
			while k or k1:
				if k:
					print(z[f:f + b])
					f += b
					k -= 1
				else:
					print(z[f:f + c])
					f += c
					k1 -= 1
			exit()
print(-1)


(n, p, q) = map(int, input().split())
s = input()
a = ''
for x in range(100 // p + 2):
	for y in range(100 // q + 2):
		if p * x + q * y == n:
			print(x + y)
			for a in range(x):
				print(s[a * p:(a + 1) * p])
			s = s[x * p:]
			for b in range(y):
				print(s[b * q:(b + 1) * q])
			quit()
else:
	print(-1)


(n, p, q) = map(int, input().split(' '))
s = input()
asdf = False
for i in range(n // p + 1):
	for j in range((n - i * p) // q + 1):
		if i * p + j * q == n and asdf == False:
			print(i + j)
			asdf = True
			for a in range(i):
				print(s[a * p:(a + 1) * p])
			for b in range(j):
				print(s[p * i + b * q:p * i + (b + 1) * q])
if asdf == False:
	print(-1)


def main():
	(n, p, q) = map(int, input().split())
	s = input()
	for i in range(0, n + 1):
		for j in range(0, n + 1):
			if p * i + q * j == n:
				print(i + j)
				for k in range(i):
					print(s[:p])
					s = s[p:]
				for k in range(j):
					print(s[:q])
					s = s[q:]
				return 0
	print(-1)
	return 0
main()


(n, p, q) = map(int, input().split())
s = list(input())
f = 0
for i in range(101):
	if f:
		break
	for j in range(101):
		if p * i + q * j == n:
			ans = []
			(l, r) = (0, 0)
			for _ in range(i):
				r += p
				ans.append(s[l:r])
				l += p
			for _ in range(j):
				r += q
				ans.append(s[l:r])
				l += q
			f = 1
			break
print(-1 if not f else len(ans))
if f:
	for t in ans:
		print(''.join(t))


import sys
(a, b, c) = input().split()
a = int(a)
b = int(b)
c = int(c)
st = input()
for x in range(100):
	for y in range(100):
		if b * x + c * y == a:
			print(x + y)
			ind = 0
			for w in range(x):
				print(st[ind:ind + b])
				ind += b
			for w in range(y):
				print(st[ind:ind + c])
				ind += c
			sys.exit()
print(-1)


import math
(n, p, q) = tuple((int(x) for x in input().split()))
word = input()

def counts(n, p, q):
	for i in range(math.ceil((n + 1) / p)):
		if (n - p * i) % q == 0:
			return (i, (n - p * i) // q)
	return None

def solve(n, p, q, word):
	_counts = counts(n, p, q)
	if _counts == None:
		print(-1)
		return
	(i, j) = _counts
	print(i + j)
	for ii in range(i):
		print(word[ii * p:ii * p + p])
	for jj in range(j):
		print(word[i * p + jj * q:i * p + jj * q + q])
solve(n, p, q, word)


def main():
	items = input().split()
	n = int(items[0])
	p = int(items[1])
	q = int(items[2])
	s = input()
	A = int(n / p)
	for a in range(A + 1):
		forq = n - a * p
		if forq % q == 0:
			b = int(forq / q)
			print(a + b)
			for i in range(a):
				print(s[i * p:(i + 1) * p])
			for i in range(b):
				print(s[a * p + i * q:a * p + (i + 1) * q])
			return
	print(-1)

def __starting_point():
	main()
__starting_point()


def gaseste(a, b, n):
	gasit = False
	k = 0
	while k * a <= n and (not gasit):
		p = 0
		while p * b + k * a <= n and (not gasit):
			if p * b + k * a == n:
				gasit = True
			else:
				p += 1
		if not gasit:
			k += 1
	return (-1, -1) if not gasit else (k, p)
(n, p, q) = map(int, input().split())
s = input()
(a, b) = gaseste(p, q, n)
if (a, b) != (-1, -1):
	i = 0
	print(a + b)
	while a > 0:
		print(s[i:i + p])
		i += p
		a -= 1
	while b > 0:
		print(s[i:i + q])
		i += q
		b -= 1
else:
	print(-1)


import os
(n, a, b) = map(int, input().split())
s = input()
maxn = n // a
x = -1
for i in range(0, maxn + 1):
	tmp = n - a * i
	if tmp % b == 0:
		x = i
		break
if x != -1:
	print(x + (n - a * x) // b)
	out = ''
	for i in range(0, x):
		out = s[a * i:(i + 1) * a]
		print(out)
	y = (n - a * x) // b
	for i in range(0, y):
		out = s[b * i + a * x:(i + 1) * b + a * x]
		print(out)
else:
	print('-1')


(n, p, q) = map(int, input().split())
s = input()
for i in range(n // p + 1):
	for j in range(n // q + 1):
		if i * p + j * q == n:
			print(i + j)
			x = 0
			cnt = 0
			while cnt < i:
				print(s[x:x + p])
				x += p
				cnt += 1
			cnt = 0
			while cnt < j:
				print(s[x:x + q])
				x += q
				cnt += 1
			exit()
print('-1')


def main():
	(n, p, q) = map(int, input().split())
	ch = input()
	d = 0
	test = False
	for i in range(100):
		for j in range(100):
			if i * p + j * q == n:
				(pp, qq) = (i, j)
				test = True
				break
		if test:
			break
	if test == False:
		print(-1)
	else:
		print(pp + qq)
		for i in range(pp):
			print(ch[d:d + p])
			d += p
		for i in range(qq):
			print(ch[d:d + q])
			d += q
main()


def solve(x, y, kappa, keepo, s):
	print(kappa + keepo)
	idx = 0
	v = [(kappa, x), (keepo, y)]
	for i in v:
		for j in range(i[0]):
			current = ''
			for k in range(i[1]):
				current += s[idx]
				idx += 1
			print(current)
	exit(0)

def swap(a, b):
	return (b, a)

def main():
	s = input()
	s = s.split(' ')
	n = int(s[0])
	x = int(s[1])
	y = int(s[2])
	s = input()
	for i in range(100 + 1):
		for j in range(100 + 1):
			if i * x + j * y == n:
				solve(x, y, i, j, s)
	print('-1')
main()


import sys
(n, p, q) = map(int, input().split())
s = input()
for i in range(101):
	if p * i <= n and (n - p * i) % q == 0:
		x = i
		y = (n - p * i) // q
		print(x + y)
		j = 0
		for _ in range(x):
			print(s[j:j + p])
			j += p
		for _ in range(y):
			print(s[j:j + q])
			j += q
		break
else:
	print(-1)


import os
(n, p, q) = map(int, input().split())
s = input()
z = 0
for i in range(0, n + 1):
	if (n - i * p) % q == 0 and n - i * p >= 0:
		print(i + (n - i * p) // q)
		k = 0
		for j in range(i):
			print(s[k:k + p])
			k += p
		for j in range((n - i * p) // q):
			print(s[k:k + q])
			k += q
		z = 1
		break
if z == 0:
	print('-1')


import sys
(n, p, q) = map(int, input().split())
s = str(input())
k = 0
for a in range(101):
	for b in range(101):
		if a * p + b * q == n:
			n = -1
			print(a + b)
			for i in range(a):
				print(s[:p])
				s = s[p:]
			for i in range(b):
				print(s[:q])
				s = s[q:]
if n != -1:
	print(-1)


(n, p, q) = map(int, input().split())
s = str(input())
for i in range(101):
	for j in range(101):
		if p * i + q * j == n:
			ans = []
			for k in range(i):
				ans.append(s[p * k:p * (k + 1)])
			for l in range(j):
				ans.append(s[p * i + q * l:p * i + q * (l + 1)])
			print(len(ans))
			for m in range(len(ans)):
				print(ans[m])
			exit()
else:
	print(-1)


import sys
from bisect import bisect_right as rb
from collections import deque
from queue import PriorityQueue
from math import *
input_ = lambda : sys.stdin.readline().strip('\r\n')
ii = lambda : int(input_())
il = lambda : list(map(int, input_().split()))
ilf = lambda : list(map(float, input_().split()))
ip = lambda : input_()
fi = lambda : float(input_())
ap = lambda ab, bc, cd: ab[bc].append(cd)
li = lambda : list(input_())
pr = lambda x: print(x)
prinT = lambda x: print(x)
f = lambda : sys.stdout.flush()
mod = 10 ** 9 + 7
(n, p, q) = il()
s = ip()
for i in range(102):
	for j in range(102):
		if p * i + q * j == n:
			print(i + j)
			m = 0
			for k in range(i):
				print(s[m:m + p])
				m += p
			for k in range(j):
				print(s[m:m + q])
				m += q
			exit(0)
print(-1)


(n, p, q) = map(int, input().split())
s = input()
for i in range(111):
	for j in range(111):
		if p * i + q * j == n:
			n = -1
			print(i + j)
			for l in range(i):
				print(s[:p])
				s = s[p:]
			for l in range(j):
				print(s[:q])
				s = s[q:]
if n != -1:
	print(-1)


def gpc(n, a, b):
	for (i, ii) in enumerate(range(0, n + 1, a)):
		for (j, jj) in enumerate(range(0, n + 1, b)):
			if ii + jj == n:
				return (i, j)
	return None
(n, p, q) = map(int, input().split())
s = input()
r = gpc(n, p, q)
if r == None:
	print(-1)
else:
	print(sum(r))
	for i in range(r[0]):
		print(s[i * p:(i + 1) * p])
	for i in range(r[1]):
		print(s[i * q + p * r[0]:(i + 1) * q + p * r[0]])


from functools import reduce
from operator import *
from math import *
from sys import *
from string import *
from collections import *
setrecursionlimit(10 ** 7)
dX = [-1, 1, 0, 0, -1, 1, -1, 1]
dY = [0, 0, -1, 1, 1, -1, -1, 1]
RI = lambda : list(map(int, input().split()))
RS = lambda : input().rstrip().split()
(n, p, q) = RI()
s = RS()[0]
for i in range(n // p + 1):
	if (n - i * p) % q == 0:
		print(i + (n - i * p) // q)
		for j in range(0, i * p, p):
			print(s[j:j + p])
		for j in range(i * p, n, q):
			print(s[j:j + q])
		exit(0)
print(-1)


(n, p, q) = input().split()
n = int(n)
p = int(p)
q = int(q)
s = input()
for i in range(100):
	for j in range(100):
		if i * p + j * q == n:
			print(i + j)
			last = 0
			for k in range(i):
				print(s[last:last + p])
				last = last + p
			for k in range(j):
				print(s[last:last + q])
				last = last + q
			exit()
print(-1)


import math

def euclid_algorithm(a, b):
	(t1, t2) = (abs(a), abs(b))
	(x1, y1, x2, y2) = (int(math.copysign(1, a)), 0, 0, int(math.copysign(1, b)))
	if t1 < t2:
		(t1, t2) = (t2, t1)
		(x1, y1, x2, y2) = (x2, y2, x1, y1)
	while t2 > 0:
		if x1 * a + y1 * b != t1:
			print('inshalla')
		k = int(t1 // t2)
		(t1, t2) = (t2, t1 % t2)
		(x1, y1, x2, y2) = (x2, y2, x1 - k * x2, y1 - k * y2)
	return (t1, x1, y1)

def opposite_element(x, p):
	(gcd, k, l) = euclid_algorithm(x, p)
	if gcd != 1:
		return -1
	return k % p

def fact_mod(n, p):
	prod = 1
	for i in range(2, n + 1):
		prod *= i
		prod %= p
	return prod
(n, p, q) = [int(x) for x in input().split()]
s = input().rstrip()
for i in range(n // p + 1):
	if (n - p * i) % q == 0:
		j = (n - p * i) // q
		print(i + j)
		for k in range(i):
			print(s[k * p:(k + 1) * p])
		for k in range(j):
			print(s[p * i + k * q:p * i + (k + 1) * q])
		break
else:
	print(-1)


(n, p, q) = map(int, input().split())
s = input()
f = True
x = 0
y = 0
for i in range(n + 1):
	for j in range(n + 1):
		if i * p + j * q == n:
			x = i
			y = j
			f = False
			break
	if not f:
		break
if f:
	print(-1)
else:
	print(x + y)
	for i in range(x):
		print(s[i * p:(i + 1) * p])
	for j in range(y):
		print(s[x * p + q * j:x * p + q * (j + 1)])


(n, a, b) = map(int, input().split())
s = input()
(k1, k2) = (0, 0)
for i in range(n + 1):
	for j in range(n + 1):
		if i * a + j * b == n:
			k1 = i
			k2 = j
			break
	if k1 or k2:
		break
else:
	print('-1')
if k1 or k2:
	print(k1 + k2)
	i = 0
	while k1:
		print(s[i:i + a])
		k1 -= 1
		i += a
	while k2:
		print(s[i:i + b])
		k2 -= 1
		i += b


(n, p, q) = map(int, input().split())
ch = input()
i = 0
j = 0
s = 0
for i in range(0, 100):
	for j in range(0, 100):
		if i * p + q * j == n:
			break
	if i * p + q * j == n:
		break
if i < 99 or j < 99:
	print(i + j)
	for z in range(0, i):
		print(ch[s:s + p])
		s = s + p
	for k in range(0, j):
		print(ch[s:s + q])
		s = s + q
else:
	print(-1)


(n, p, q) = map(int, input().split())
s = input()
k = 0
l = 0
r = 0
for i in range(n + 1):
	for j in range(n + 1):
		if i * p + j * q == n:
			r += 1
			print(i + j)
			while k < i:
				print(s[k * p:p * (k + 1)])
				k += 1
			while l < j:
				print(s[p * (k + 1) + l * q - p:p * (k + 1) + (l + 1) * q - p])
				l += 1
		if r >= 1:
			break
	if r >= 1:
		break
if r == 0:
	print('-1')


(n, p, q) = [int(x) for x in input().split()]
s = input()
done = False
for i in range(1 + n // p):
	if (n - i * p) % q == 0:
		print(i + (n - i * p) // q)
		for x in range(i):
			print(s[x * p:(x + 1) * p])
		for x in range((n - i * p) // q):
			print(s[i * p + x * q:i * p + (x + 1) * q])
		done = True
		break
if not done:
	print(-1)


(n, p, q) = list(map(int, input().split()))
s = input().strip()
fps = [x * p for x in range(n // p + 1)]
fqs = [x * q for x in range(n // q + 1)]
for fp in fps:
	for fq in fqs:
		if fp + fq == n:
			ps = fps.index(fp)
			qs = fqs.index(fq)
			start = 0
			end = 0
			print(ps + qs)
			for i in range(1, n + 1):
				if start >= n:
					break
				if i <= ps:
					end += p
				else:
					end += q
				print(s[start:end])
				start = end
			exit()
print(-1)


from sys import argv, exit

def rstr():
	return input()

def rint():
	return int(input())

def rints():
	return [int(i) for i in input().split(' ')]

def prnt(*args):
	if '-v' in argv:
		print(*args)

def shieldthing(n, p, q):
	shield = n
	eb = p
	iv = q
	ebn = 0
	ivn = 0
	while shield > 0:
		if shield % iv == 0:
			ivn = shield / iv
			return (ebn, ivn)
		shield -= eb
		ebn += 1
	if shield == 0:
		return (ebn, ivn)
	return (-1, -1)
(n, p, q) = rints()
s = rstr()
(pn, qn) = shieldthing(n, p, q)
if pn == -1:
	print('-1')
	exit(0)
print(int(pn + qn))
i = 0
while pn > 0:
	print(s[i:i + p])
	i = i + p
	pn -= 1
while qn > 0:
	print(s[i:i + q])
	i = i + q
	qn -= 1


import sys
(n, p, q) = map(int, input().split())
s = input()
for i in range(0, 101):
	for j in range(0, 101):
		if p * i + q * j == n:
			print(i + j)
			for o in range(0, i):
				print(s[o * p:(o + 1) * p])
			s = s[i * p:]
			for o in range(0, j):
				print(s[o * q:(o + 1) * q])
			sys.exit()
print(-1)


npq = [int(i) for i in input().split()]
word = input()
for i in range(100):
	for j in range(100):
		if i * npq[1] + j * npq[2] == npq[0]:
			print(i + j)
			for k in range(i):
				print(word[:npq[1]])
				word = word[npq[1]:]
			for l in range(j):
				print(word[:npq[2]])
				word = word[npq[2]:]
			quit()
print(-1)


import sys
(n, p, q) = map(int, input().split())
s = input()
for i in range(n // p + 1):
	v = n - i * p
	if v % q == 0:
		ans = []
		pos = 0
		for j in range(i):
			ans.append(s[pos:pos + p])
			pos += p
		for j in range(v // q):
			ans.append(s[pos:pos + q])
			pos += q
		print(len(ans))
		for j in ans:
			print(j)
		exit(0)
print(-1)


(n, p, q) = map(int, input().split())
s = input()
ansp = 0
ansq = 0
z = 0
for i in range(int(n / p) + 1):
	if (n - i * p) % q == 0:
		ansp = i
		ansq = (n - i * p) // q
		z = 1
		break
if z == 0:
	print('-1')
else:
	k = 0
	print(ansq + ansp)
	while (ansp == 0) + (ansq == 0) != 2:
		if ansp != 0:
			print(s[k:k + p])
			ansp -= 1
			k = k + p
		else:
			print(s[k:k + q])
			k = k + q
			ansq -= 1


(n, p, q) = map(int, input().split())
s = input()
found = False
for k1 in range(100):
	if found:
		break
	for k2 in range(100):
		if found:
			break
		if k1 * p + k2 * q == len(s):
			ans = (k1, k2)
			found = True
if not found:
	print(-1)
	exit(0)
idx = 0
(k1, k2) = ans
print(k1 + k2)
while k1:
	print(s[idx:idx + p])
	idx += p
	k1 -= 1
while k2:
	print(s[idx:idx + q])
	idx += q
	k2 -= 1


def calc_splits(n, q, p):
	max_q = int(n / q) + 1
	max_p = int(n / p) + 1
	for k in range(0, max_q):
		value = q * k
		if (n - value) % p == 0:
			return (k, q, int((n - value) / p), p)
	for i in range(0, max_p):
		value = p * i
		if (n - value) % q == 0:
			return (k, p, int((n - value) / q), q)
	return -1
_in = input()
(n, p, q) = _in.split(' ')
(n, p, q) = (int(n), int(p), int(q))
string = input()
value = calc_splits(n, p, q)
if value == -1:
	print(-1)
else:
	(k1, v1, k2, v2) = value
	print(k1 + k2)
	counter = 0
	for i in range(1, k1 + k2 + 1):
		if i <= k1:
			print(string[counter:counter + v1])
			counter += v1
		else:
			print(string[counter:counter + v2])
			counter += v2


(m, p, q) = map(int, input().split())
s = str(input())
lp = 0
lq = 0
for i in range(m + 1):
	for j in range(m + 1):
		if i * p + j * q == m:
			lp = i
			lq = j
			break
	if lp + lq > 0:
		break
if lp + lq == 0:
	print(-1)
else:
	print(lp + lq)
	aux = 0
	for i in range(lp):
		print(s[aux:aux + p])
		aux = aux + p
	for i in range(lq):
		print(s[aux:aux + q])
		aux = aux + q


INF = 10000
(n, p, q) = map(int, input().split())
s = input()
res = []
exit_flag = False
for i in range(INF):
	if exit_flag:
		break
	for j in range(INF):
		size = i * p + j * q
		if size == n:
			for auxi in range(i):
				res.append(s[:p])
				s = s[p:]
			for auxj in range(j):
				res.append(s[:q])
				s = s[q:]
			print(len(res))
			for word in res:
				print(word)
			exit(0)
		if i * p > n and j * p > n:
			exit_flag = True
			break
print(-1)


import sys
(n, p, q) = list(map(int, input().split()))
s = input()
for a in range(n + 1):
	for b in range(n + 1):
		if a * p + b * q == n:
			print(a + b)
			for i in range(a):
				print(s[i * p:i * p + p])
			s = s[p * a:]
			p = q
			a = b
			for i in range(a):
				print(s[i * p:i * p + p])
			sys.exit(0)
print('-1')


(n, p, q) = map(int, input().split())
s = input()
for i in range(101):
	for j in range(101):
		if p * i + q * j == n:
			print(i + j)
			for m in range(i):
				print(s[:p])
				s = s[p:]
			for t in range(j):
				print(s[:q])
				s = s[q:]
			quit()
print(-1)


import sys

def fun():
	try:
		(n, p, q) = map(int, input().split())
		s = input()
	except ValueError:
		print('输入出错')
		return
	(x, y) = map(int, Calpq(n, p, q, 0))
	if x < 0:
		print(-1)
	else:
		print(x + y)
		for i in range(x):
			print(s[p * i:p * (i + 1)])
		k = p * x
		for i in range(y):
			print(s[k + q * i:k + q * (i + 1)])
	pass

def Calpq(n, p, q, pn):
	k = n - p * pn
	if k < 0:
		return (-1, -1)
	elif k % q == 0:
		return (pn, k // q)
	else:
		return Calpq(n, p, q, pn + 1)
fun()


(n, p, q) = map(int, input().split())
s = input()
for i in range(0, n // p + 1):
	if (n - i * p) % q == 0:
		print(i + (n - i * p) // q)
		for x in range(0, i):
			ss = s[:p]
			print(ss)
			s = s[p:]
		for x in range(0, (n - i * p) // q):
			ss = s[:q]
			print(ss)
			s = s[q:]
		exit()
print(-1)


(n, x, y) = map(int, input().split())
s = input()
a = -1
b = -1
for i in range(n // y + 1):
	if (n - i * y) % x == 0:
		(a, b) = ((n - i * y) // x, i)
i = -1
if a == -1:
	print('-1')
	exit()
print(a + b)
for i in range(a):
	print(s[i * x:(i + 1) * x])
s = s[(i + 1) * x:]
for j in range(b):
	print(s[j * y:(j + 1) * y])


(n, p, q) = list(map(int, input().split()))
s = input()
res = (-1, -1)
for i in range(n + 1):
	if res[0] != -1:
		break
	for j in range(n + 1):
		ans = i * p + j * q
		if ans == n:
			res = (i, j)
			break
if res[0] == -1:
	print('-1')
	exit()
print(res[0] + res[1])
ind = 0
for i in range(res[0]):
	print(s[ind:ind + p])
	ind += p
for i in range(res[1]):
	print(s[ind:ind + q])
	ind += q


(n, p, q) = [int(x) for x in input().split(' ')]
string = input()
s = list()
for i in range(n + 1):
	for j in range(n + 1):
		if n == i * p + j * q:
			print(i + j)
			index = 0
			for k in range(i):
				s.append(string[index:index + p])
				index += p
			for k in range(j):
				s.append(string[index:index + q])
				index += q
			for k in s:
				print(k)
			exit()
print(-1)


import sys
(n, p, q) = map(int, sys.stdin.readline().split())
word = list(input())
sol = -1
for i in range(0, int(n / p) + 1):
	for j in range(0, int(n / q) + 1):
		if i * p + j * q == n:
			sol = i + j
			print(sol)
			for k in range(0, n):
				sys.stdout.write(word[k])
				if i and k < i * p and (not (k + 1) % p) or (j and k >= i * p and (not (k - i * p + 1) % q)):
					print('')
			sys.exit(0)
		if sol != -1:
			break
if sol == -1:
	print('-1')


(n, p, q) = map(int, input().split())
s = input()
flag = False
a = -1
b = -1
for i in range(len(s) // p + 1):
	if flag:
		break
	for j in range(len(s) // q + 1):
		if i * p + j * q == n:
			flag = True
			a = i
			b = j
			break
if a == -1:
	print(-1)
else:
	print(a + b)
	for i in range(0, a):
		print(s[p * i:p * i + p])
	for j in range(0, b):
		if a != 0:
			print(s[q * j + (i + 1) * p:q * j + q + (i + 1) * p])
		else:
			print(s[q * j:q * j + q])


import os

def main():
	(n, p, q) = map(int, input().split())
	(x, y) = (0, 0)
	for i in range(0, n + 1):
		if n >= i * p and (n - i * p) % q == 0:
			x = i
			y = (n - i * p) // q
			break
	s = input()
	cur = 0
	if x * p + q * y != n:
		print(-1)
		return
	print(x + y)
	for i in range(x):
		print(s[cur:cur + p])
		cur += p
	for i in range(y):
		print(s[cur:cur + q])
		cur += q
main()


(n, p, q) = [int(x) for x in input().split()]
s = input()
for i in range(0, n + 1):
	if n - i * p < 0:
		break
	if (n - i * p) % q == 0:
		ans = []
		for j in range(i):
			ans.append(s[j * p:j * p + p])
		for j in range((n - i * p) // q):
			ans.append(s[p * i + j * q:p * i + j * q + q])
		print(len(ans))
		for elem in ans:
			print(elem)
		exit()
print(-1)