import random
import sys
MAXN = int(sys.argv[1])
MAXS = int(sys.argv[2])
MAXST = int(sys.argv[3])
MAXSUMST = 1000

N = random.randint(max(1, MAXN * 9 / 10), MAXN)
print N
print ''.join([random.choice("ABCDEFGHIJKLMNOPQRSTUVWXYZ") for i in xrange(random.randint(max(1, MAXS * 9 / 10), MAXS))])
s = 0

for i in xrange(N):
    lenS = random.randint(1, min(MAXST, MAXSUMST - s - N + i + 1))
    s += lenS
    print ''.join([random.choice("abcdefghijklmnopqrstuvwxyz") for i in xrange(lenS)])
