You are given three positive integers $n$, $a$ and $b$. You have to construct a string $s$ of length $n$ consisting of lowercase Latin letters such that each substring of length $a$ has exactly $b$ distinct letters. It is guaranteed that the answer exists.

You have to answer $t$ independent test cases.

Recall that the substring $s[l \dots r]$ is the string $s_l, s_{l+1}, \dots, s_{r}$ and its length is $r - l + 1$. In this problem you are only interested in substrings of length $a$.


-----Input-----

The first line of the input contains one integer $t$ ($1 \le t \le 2000$) — the number of test cases. Then $t$ test cases follow.

The only line of a test case contains three space-separated integers $n$, $a$ and $b$ ($1 \le a \le n \le 2000, 1 \le b \le \min(26, a)$), where $n$ is the length of the required string, $a$ is the length of a substring and $b$ is the required number of distinct letters in each substring of length $a$.

It is guaranteed that the sum of $n$ over all test cases does not exceed $2000$ ($\sum n \le 2000$).


-----Output-----

For each test case, print the answer — such a string $s$ of length $n$ consisting of lowercase Latin letters that each substring of length $a$ has exactly $b$ distinct letters. If there are multiple valid answers, print any of them. It is guaranteed that the answer exists.


-----Example-----
Input
4
7 5 3
6 1 1
6 6 1
5 2 2

Output
tleelte
qwerty
vvvvvv
abcde



-----Note-----

In the first test case of the example, consider all the substrings of length $5$:  "tleel": it contains $3$ distinct (unique) letters,  "leelt": it contains $3$ distinct (unique) letters,  "eelte": it contains $3$ distinct (unique) letters.

Source: codeforces | Difficulty: EASY
Tags: Constructive algorithms


Solutions:
t = input()
t = int(t)
for i in range(t):
	list1 = list()
	list2 = list()
	str1 = input()
	list3 = str1.split()
	n = int(list3[0])
	a = int(list3[1])
	b = int(list3[2])
	for j in range(b):
		list1.append(chr(j + 97))
	k = b
	list2 = list1[:]
	some = -1
	while k < a:
		list1.append(list2[some])
		if some * -1 != b:
			some -= 1
		else:
			some = -1
		k += 1
	some = 0
	while k < n:
		list1.append(list1[some])
		if some + 1 != a:
			some += 1
		else:
			some = 0
		k += 1
	str2 = ''.join(list1)
	print(str2)


for _ in range(int(input())):
	c = 97
	(n, a, b) = map(int, input().split())
	s = ''
	for i in range(b):
		s += chr(c)
		c += 1
	d = n // b
	r = n % b
	s = s * d
	s = s + s[:r]
	print(s)


import random
al = 'qwertyuiopasdfghjklzxcvbnm'
for _ in range(int(input())):
	(n, a, b) = map(int, input().split())
	for i in range(n):
		print(al[0 + i % b], end='')
	print()


n = int(input())
alph = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
for i in range(n):
	(a, b, c) = map(int, input().split())
	ans = ''
	while a != len(ans):
		for q in range(c):
			if len(ans) + 1 <= a:
				ans += alph[q]
			else:
				break
	print(ans)


t = int(input())
for _ in range(t):
	(n, a, b) = map(int, input().split())
	s = 'abcdefghijklmnopqrstuvwxyz'
	print(s[:b] * (n // b) + s[:n % b])


for k in range(int(input())):
	(n, a, b) = map(int, input().split())
	s = ''
	i = b
	for i in range(b):
		s = s + chr(97 + i)
	s = s * (a // len(s))
	new = s
	curr = ''
	for i in range(1, b):
		curr = s + s[0:i]
		if len(curr) == a:
			new = curr
			break
	new = new * (n // len(new))
	curr = ''
	word = new
	for i in range(1, a):
		curr = new + new[0:i]
		if len(curr) == n:
			word = curr
			break
	print(word)


t = int(input())
for _ in range(t):
	(n, a, b) = map(int, input().split())
	s = []
	for i in range(n):
		if i < b:
			s.append(chr(97 + i))
			print(chr(97 + i), end='')
		elif i < a:
			s.append(s[b - 1])
			print(s[b - 1], end='')
		else:
			s.append(s[i - a])
			print(s[i - a], end='')
	print('')


t = int(input())
for i in range(t):
	(n, a, b) = map(int, input().split())
	s = ''
	for i in range(97, 97 + b):
		s += chr(i)
	for i in range(0, n - b):
		s += s[i]
	print(s)


import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, copy, functools
sys.setrecursionlimit(10 ** 7)
inf = 10 ** 20
eps = 1.0 / 10 ** 10
mod = 10 ** 9 + 7
mod2 = 998244353
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]

def LI():
	return list(map(int, sys.stdin.readline().split()))

def LLI():
	return [list(map(int, l.split())) for l in sys.stdin.readlines()]

def LI_():
	return [int(x) - 1 for x in sys.stdin.readline().split()]

def LF():
	return [float(x) for x in sys.stdin.readline().split()]

def LS():
	return sys.stdin.readline().split()

def I():
	return int(sys.stdin.readline())

def F():
	return float(sys.stdin.readline())

def S():
	return input()

def pf(s):
	return print(s, flush=True)

def pe(s):
	return print(str(s), file=sys.stderr)

def JA(a, sep):
	return sep.join(map(str, a))

def JAA(a, s, t):
	return s.join((t.join(map(str, b)) for b in a))

def main():
	t = I()
	rr = []
	for _ in range(t):
		(n, a, b) = LI()
		r = [chr(ord('a') + i % b) for i in range(n)]
		rr.append(JA(r, ''))
	return JA(rr, '\n')
print(main())


listf = []
list1 = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
t = int(input())
for x in range(t):
	c = 0
	i = input().split()
	list2 = []
	n = int(i[0])
	a = int(i[1])
	b = int(i[2])
	while True:
		for y in range(b):
			list2.append(list1[y])
			if len(list2) == n:
				c = 1
				break
		if c == 1:
			break
	m = ''
	for r in list2:
		m += r
	listf.append(m)
for g in listf:
	print(g)


from math import ceil

def solve(n, a, b):
	ALPHA = 'abcdefghijklmnopqrstuvwxyz'
	chars = ALPHA[:b]
	chars_length = len(chars)
	res = []
	length = 0
	i = 0
	while length < n:
		res.append(chars[i % chars_length])
		i += 1
		length += 1
	return ''.join(res)
for _ in range(int(input())):
	(n, a, b) = map(int, input().split())
	print(solve(n, a, b))


master = 'qwertyuioplkjhgfdsazxcvbnm'

def func(n, a, b):
	sub = master[:b]
	ans = sub * (n // b) + sub[:n % b]
	return ans
for _ in range(int(input())):
	(n, a, b) = map(int, input().split())
	print(func(n, a, b))


letters = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
N = int(input())
for _ in range(N):
	(n, a, b) = map(int, input().split())
	ans = ''
	for i in range(n):
		ans += letters[i % b]
	print(ans)


st = 'abcdefghijklmnopqrstuvwxyz'
t = int(input())
for _ in range(t):
	(n, a, c) = map(int, input().split())
	r = n // c
	for i in range(r):
		for j in range(c):
			print(st[j], end='')
	r = n % c
	for i in range(r):
		print(st[i], end='')
	print()


for _ in range(int(input())):
	(n, a, b) = map(int, input().split())
	d = [chr(i) for i in range(97, 97 + 26)]
	ans = []
	for i in range(b):
		ans.append(d[i])
	for j in range(b, a):
		ans.append(d[b - 1])
	for j in range(a, n):
		ans.append(ans[j - a])
	print(''.join(ans))


def solve(n, a, b):
	unique = 'a'
	for i in range(1, b):
		unique += chr(97 + i)
	for i in range(0, a - b):
		unique += 'a'
	ans = unique * int(n // a) + unique[0:n % a]
	print(ans)
t = int(input())
for i in range(0, t):
	line = list(map(lambda x: int(x), input().split()))
	n = line[0]
	a = line[1]
	b = line[2]
	solve(n, a, b)


for case in range(int(input())):
	(n, a, b) = list(map(int, input().split()))
	s = 'a' * (a - b + 1)
	for i in range(b - 1):
		s += chr(97 + i + 1)
	for i in range(a, n):
		s += s[i - a]
	print(s)


import sys
import math
import itertools
import functools
import collections
import operator
import fileinput
import copy
ORDA = 97

def ii():
	return int(input())

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

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

def lcm(a, b):
	return abs(a * b) // math.gcd(a, b)

def revn(n):
	return str(n)[::-1]

def dd():
	return collections.defaultdict(int)

def ddl():
	return collections.defaultdict(list)

def sieve(n):
	if n < 2:
		return list()
	prime = [True for _ in range(n + 1)]
	p = 3
	while p * p <= n:
		if prime[p]:
			for i in range(p * 2, n + 1, p):
				prime[i] = False
		p += 2
	r = [2]
	for p in range(3, n + 1, 2):
		if prime[p]:
			r.append(p)
	return r

def divs(n, start=1):
	r = []
	for i in range(start, int(math.sqrt(n) + 1)):
		if n % i == 0:
			if n / i == i:
				r.append(i)
			else:
				r.extend([i, n // i])
	return r

def divn(n, primes):
	divs_number = 1
	for i in primes:
		if n == 1:
			return divs_number
		t = 1
		while n % i == 0:
			t += 1
			n //= i
		divs_number *= t

def prime(n):
	if n == 2:
		return True
	if n % 2 == 0 or n <= 1:
		return False
	sqr = int(math.sqrt(n)) + 1
	for d in range(3, sqr, 2):
		if n % d == 0:
			return False
	return True

def convn(number, base):
	newnumber = 0
	while number > 0:
		newnumber += number % base
		number //= base
	return newnumber

def cdiv(n, k):
	return n // k + (n % k != 0)
t = 'abcdefghijklmnopqrstuvwxyz'
for i in range(ii()):
	(n, a, b) = mi()
	print(t[:b] * (n // b) + t[:n % b])


def sol():
	t = int(input())
	for _ in range(t):
		(n, a, b) = map(int, input().split())
		nn = 0
		bb = 0
		aa = 0
		rslt = ''
		while nn < n:
			rslt += chr(97 + bb)
			aa += 1
			bb += 1
			nn += 1
			if bb == b:
				bb = 0
		print(rslt)
sol()


test = int(input())
while test:
	(n, a, b) = input().split()
	n = int(n)
	a = int(a)
	b = int(b)
	s = []
	c = a - b
	i = 0
	if c != 0:
		temp = 'a'
		for j in range(c + 1):
			s.append('a')
		i = c + 1
		while i < a:
			temp = chr(ord(temp) + 1)
			s.append(temp)
			i += 1
		for j in range(a, n):
			s.append(s[j - a])
		d = ''.join([str(i) for i in s])
		print(d)
	else:
		for i in range(n):
			s.append(chr(ord('a') + i % 26))
		d = ''.join([str(i) for i in s])
		print(d)
	test -= 1


t = int(input())
for i in range(t):
	(n, a, b) = map(int, input().split())
	for i in range(n):
		print(chr(97 + i % b), end='')
	print()


from string import ascii_lowercase as alph
for x in range(int(input())):
	(n, a, b) = map(int, input().split())
	out = 'a'
	i = 0
	for x in range(1, n):
		substr = out[max(0, x - a + 1):x]
		if len(set(substr)) != b:
			i = (i + 1) % 26
		out += alph[i]
	print(out)


t = int(input())
z = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
for i in range(t):
	(n, a, b) = map(int, input().split())
	s = list('abcdefghijklmnopqrstuvwxyz')
	print(''.join(s[:b] * (n // b) + s[:n % b]))


for _ in range(int(input())):
	(n, a, b) = map(int, input().split())
	block = ''
	sym = 'a'
	for i in range(a):
		block += sym
		sym = chr(ord(sym) + 1)
		if ord(sym) == ord('a') + b:
			sym = 'a'
	ans = n // a * block
	ans += block[:n % a]
	print(ans)


def NO():
	return print('NO')

def YES():
	return print('YES')

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

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

def STR():
	return input()

def MAP():
	return map(int, input().split())
import string
for _ in range(INT()):
	(n, a, b) = MAP()
	letters = list(string.ascii_lowercase)
	ans = []
	cnt = 0
	cnt2 = 0
	if a == b:
		for i in range(n):
			ans.append(letters[cnt2])
			cnt2 += 1
			if cnt2 > 25:
				cnt2 = 0
	elif b == 1:
		for i in range(n):
			ans.append(letters[0])
	else:
		for _ in range(n):
			ans.append(letters[cnt])
			cnt += 1
			if cnt > b - 1:
				cnt = 0
	print(''.join(ans))


import math
loop_time = int(input())
for time in range(0, loop_time):
	inp_array = input()
	inp_array = inp_array.split(' ')
	n = int(inp_array[0])
	a = int(inp_array[1])
	b = int(inp_array[2])
	period_unit = ''
	for ii in range(0, b):
		period_unit = period_unit + chr(97 + ii)
	print(period_unit * int(math.floor(n / b)) + period_unit[0:n % b])


import sys
t = int(input())
for i in range(t):
	(n, a, b) = map(int, input().split())
	s = ''
	for j in range(n // a + 1):
		s = s + 'a' * (a - b + 1)
		for t in range(b - 1):
			s = s + chr(t + 98)
	print(s[0:n])


I = lambda : list(map(int, input().split()))
s = 'abcdefghijklmnopqrstuvwxyz'
for tc in range(int(input())):
	(n, a, b) = I()
	ss = s[:b]
	x = ss * 2001
	print(x[:n])


import math
for _ in range(int(input())):
	(n, a, b) = map(int, input().split())
	(x, str34) = ('', '')
	for i in range(1, b + 1):
		x += chr(96 + i)
	str34 = x * math.ceil(n / b)
	if len(str34) > n:
		str34 = str34[len(str34) - n:]
	print(str34)


alf = 'abcdefghijklmnopqrstuvwxyz'
n = int(input())
for j in range(n):
	tmp = ''
	(n, m, k) = map(int, input().split())
	tmp = alf[:k]
	res = tmp
	for i in range(n // k - 1):
		res += tmp
	res += alf[:n - len(res)]
	print(res)


def cts(n, a, b):
	s = ''
	for i in range(0, n):
		s = s + chr(97 + i % b)
	print(s)
	return
t = int(input())
for i in range(t):
	T = input()
	l = list(map(int, T.split(' ')))
	cts(l[0], l[1], l[2])


alphabets = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
t = int(input())
while t:
	(n, a, b) = [int(x) for x in input().split()]
	word = str()
	i = 0
	while i <= b:
		if len(word) == n:
			break
		word += alphabets[i]
		if i == b - 1:
			i = 0
		else:
			i += 1
	print(word)
	t -= 1


t = int(input())
for i in range(t):
	(n, a, b) = list(map(int, input().split()))
	rem = a // b
	str = ''
	i = 97
	for j in range(b):
		str1 = ''
		for k in range(rem):
			str1 += chr(i)
		i += 1
		str += str1
	res = ''
	while len(res) <= n:
		res += str[0:a:1]
	res = res[0:n:1]
	print(res)


from math import ceil, sqrt, log, gcd

def ii():
	return int(input())

def si():
	return input()

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

def li():
	return list(mi())
abc = []
for i in range(26):
	abc.append(chr(97 + i))
for _ in range(ii()):
	(n, a, b) = mi()
	y = ['z'] * (a - b)
	if len(y) == 0:
		x = abc[:n]
		ans = []
		while len(ans) <= n + 5:
			ans = ans + x
			ans += y
	else:
		x = abc[:b - 1]
		ans = []
		while len(ans) <= n + 5:
			ans = ans + x
			ans += y
	ans = ans[:n]
	ans = ''.join(ans)
	print(ans)


test = int(input())
sol = []
while test:
	test -= 1
	(n, a, b) = tuple(map(int, input().split()))
	s = ''
	for i in range(b):
		s += chr(97 + i)
	h = len(s)
	for i in range(b, a):
		s += s[h - 1]
		h += 1
	while h < n:
		s += s[h - a]
		h += 1
	sol.append(s)
for i in sol:
	print(i)


test = []
alpha = 'a'
for i in range(0, 26):
	test.append(alpha)
	alpha = chr(ord(alpha) + 1)
t = int(input())
for _ in range(t):
	(a, b, c) = map(int, input().split())
	answer = ''
	for i in range(c):
		answer = answer + test[i]
	answer = answer * a
	answer = answer[:a]
	print(answer)


from string import ascii_lowercase
s = ascii_lowercase
for i in range(int(input())):
	(n, a, b) = [int(i) for i in input().split()]
	if a != 1:
		c = s[0] * (a - b) + s[:b]
		ans = c * (n // a)
		print(ans + c[:n % a])
	else:
		ans = s * (n // 26)
		print(ans + s[:n % 26])


t = int(input())
while t > 0:
	t -= 1
	(n, a, b) = [int(x) for x in input().split()]
	arr = [chr(x) for x in range(ord('a'), ord('z') + 1)]
	arr = arr[:b]
	string = []
	ans = ''
	for i in range(a):
		string.append(arr[i % b])
	for i in range(n):
		ans += string[i % a]
	print(ans)


t = int(input())
alp = 'qwertyuiopasdfghjklzxcvbnm'
for i in range(t):
	(n, a, b) = map(int, input().split())
	s = alp[:b] + alp[0] * (a - b)
	k = n // a
	ans = k * s + s[:n % a]
	print(ans)


for x in range(int(input())):
	final = ''
	letters = []
	sublength = ''
	(strlength, patch, distinct) = list(map(int, input().split()))
	alphabet = 'abcdefghijklmnopqrstuvwxyz'
	if patch == distinct:
		if strlength < 27:
			final += alphabet[0:strlength]
		else:
			(num, part) = divmod(strlength, len(alphabet))
			for x in range(num):
				final += alphabet
			final += alphabet[0:part]
	else:
		for x in range(distinct):
			letters.append(alphabet[x])
		count = 0
		while True:
			if len(sublength) < patch:
				try:
					sublength += letters[count]
				except:
					count = 0
					sublength += letters[count]
				count += 1
			else:
				break
		(num, part) = divmod(strlength, patch)
		for x in range(num):
			final += sublength
		final += sublength[0:part]
	print(final)


alphabet = 'abcdefghijklmnopqrstuvwxyz'
t = int(input())
for i in range(t):
	(n, a, b) = map(int, input().split())
	current_alph = alphabet[:b]
	final_string = []
	for j in range(n):
		final_string.append(current_alph[j % len(current_alph)])
	print(''.join(final_string))


t = int(input())
for _ in range(t):
	(n, a, b) = map(int, input().split())
	print(''.join((chr(97 + i % b) for i in range(n))))


for _ in range(int(input())):
	(n, a, b) = list(map(int, input().split()))
	print((''.join((chr(97 + x) for x in range(b))) * (n // b + 1))[:n])


w = int(input())
for q in range(w):
	(n, a, b) = map(int, input().split())
	s = ''
	m = 97
	ans = ''
	for i in range(b):
		s += chr(m)
		m += 1
	ans += s * (n // b)
	m = 97
	for i in range(n % b):
		ans += chr(m)
		m += 1
	print(ans)


t = int(input())
alp = 'abcdefghijklmnopqrstuvwxyz'
for i in range(0, t):
	ans = ''
	nab = list(map(int, input().split()))
	if nab[1] == nab[2]:
		for i in range(0, nab[0]):
			ans = ans + alp[i % 26]
	elif nab[2] == 1:
		for i in range(0, nab[0]):
			ans = ans + 't'
	else:
		i = 0
		while i < nab[0]:
			ans = ans + alp[i % nab[2]]
			i = i + 1
	print(ans)


def modinv(n, p):
	return pow(n, p - 2, p)

def main():
	original = 'qwertyuioplkjhgfdsazxcvbnm'
	for case in range(int(input())):
		(n, a, b) = [int(x) for x in input().split()]
		default = original[:b]
		default += 'q' * (a - b)
		for i in range(n):
			print(default[i % a], end='')
		print()
py2 = round(0.5)
if py2:
	from future_builtins import ascii, filter, hex, map, oct, zip
	range = xrange
import os, sys
from io import IOBase, BytesIO
BUFSIZE = 8192

class FastIO(BytesIO):
	newlines = 0

	def __init__(self, file):
		self._file = file
		self._fd = file.fileno()
		self.writable = 'x' in file.mode or 'w' in file.mode
		self.write = super(FastIO, self).write if self.writable else None

	def _fill(self):
		s = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
		self.seek((self.tell(), self.seek(0, 2), super(FastIO, self).write(s))[0])
		return s

	def read(self):
		while self._fill():
			pass
		return super(FastIO, self).read()

	def readline(self):
		while self.newlines == 0:
			s = self._fill()
			self.newlines = s.count(b'\n') + (not s)
		self.newlines -= 1
		return super(FastIO, self).readline()

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

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		if py2:
			self.write = self.buffer.write
			self.read = self.buffer.read
			self.readline = self.buffer.readline
		else:
			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))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


for _ in range(int(input())):
	(n, a, b) = map(int, input().split())
	init = ''
	x = 97
	for i in range(b):
		init += chr(x)
		x += 1
	i = 0
	x = 0
	for i in range(a - len(init)):
		init += init[x]
		x += 1
	i = 0
	x = 0
	for i in range(n - len(init)):
		init += init[x]
		x += 1
	print(init)


for _ in range(int(input())):
	(n, a, b) = map(int, input().split())
	s = ''
	c = 0
	clo = 97
	while c < a:
		if b > 0:
			s += chr(clo)
			b -= 1
			clo += 1
		else:
			s += s[-1]
		c += 1
	print(s * (n // a) + s[:n - n // a * a])


t = int(input())
for g in range(t):
	inp = input().split()
	n = int(inp[0])
	a = int(inp[1])
	b = int(inp[2])
	st = ''
	for x in range(b):
		st = st + chr(97 + x)
	st = st * (n // b)
	c = n % b
	for x in range(c):
		st = st + chr(97 + x)
	print(st)


t = int(input())
for _ in range(t):
	(n, a, b) = map(int, input().split())
	same = a - b + 1
	s = ''
	cnt = 97
	s = 'a' * same
	for j in range(a - same):
		s = chr(cnt + 1 + j) + s
	rem = n - a
	ind = 0
	for j in range(rem):
		s = s + s[ind]
		ind += 1
	print(s)


import sys
input = sys.stdin.readline
from math import *
t = int(input())
while t > 0:
	t -= 1
	(n, a, b) = map(int, input().split())
	p = 'abcdefghijklmnopqrstuvwxyz'
	s = ''
	for i in range(n):
		s += p[i % b]
	print(s)


from sys import stdin, stdout
ii1 = lambda : int(stdin.readline().strip())
is1 = lambda : stdin.readline().strip()
iia = lambda : list(map(int, stdin.readline().strip().split()))
isa = lambda : stdin.readline().strip().split()
mod = 1000000007
tc = ii1()
s = 'abcdefghijklmnopqrstuvwxyz'
for _ in range(tc):
	(n, a, b) = iia()
	if n % b == 0:
		ans = s[:b] * (n // b)
	else:
		ans = s[:b] * (n // b) + s[:b][:n % b]
	print(ans)


import sys
import io, os
import math
import bisect

def main():
	t = int(input())
	for i in range(t):
		(n, a, b) = map(int, input().split())
		ans = [chr(int(i) + 97) for i in range(b)]
		ans = ans * (n // b)
		empty = [chr(int(i) + 97) for i in range(n % b)]
		ans += empty
		print(''.join(ans))
main()


import sys
input = sys.stdin.readline
from collections import *
from math import *
t = int(input())
while t:
	t -= 1
	(n, a, b) = map(int, input().split())
	s = 'abcdefghijklmnopqrstuvwxyz'
	r = s[:b]
	r += r[-1] * (a - b)
	ss = []
	g = len(r)
	for i in range(n):
		ss.append(r[i % g])
	ss = ''.join(ss)
	print(ss)


for _ in range(int(input())):
	(n, a, b) = map(int, input().split())
	s = ''
	for k in range(n // a + 1):
		for i in range(b):
			s += chr(97 + i)
		s += chr(97 + b - 1) * (a - b)
	l = [char for char in s]
	del l[n:]
	s = ''
	s = s.join(l)
	print(s)


alphabet = 'abcdefghijklmnopqrstuvwxyz'
tc = int(input())
for i in range(tc):
	(n, a, b) = (int(i) for i in input().split())
	l = []
	j = 1
	for i in range(n):
		if j > b or j > 26:
			j = 1
		if j <= b:
			l.append(j)
			j += 1
	s = ''
	for i in range(n):
		s += alphabet[l[i] - 1]
	print(s)


test = int(input())
for _ in range(test):
	(n, l, d) = map(int, input().split())
	s = ''
	chars = []
	for i in range(d):
		chars.append(chr(i + 97))
	for i in range(n):
		s += chars[i % d]
	print(s)


t = int(input())
for x in range(t):
	(n, a, b) = map(int, input().split())
	s1 = ''
	s = ''
	for y in range(b):
		s1 += chr(97 + y)
	for y in range(n // b):
		s += s1
	s += s[:n - n // b * b]
	print(s)


for _ in range(int(input())):
	li = []
	x = 'abcdefghijklmnopqrstuvwxyz'
	(sl, n, d) = [int(x) for x in input().split()]
	for i in x:
		li.append(i)
		if len(li) < d:
			continue
		else:
			break
	for i in range(sl):
		print(li[i % d], end='')
	print('')


for _ in range(int(input())):
	(n, a, b) = map(int, input().split())
	z = 97
	if a == b:
		x = ''
		for i in range(b):
			x += chr(z)
			z += 1
	else:
		x = ''
		for i in range(b):
			x += chr(z)
			z += 1
	while len(x) < n:
		x += x
	print(x[:n])


def solve():
	(n, a, b) = input().split()
	n = int(n)
	a = int(a)
	b = int(b)
	alphabet = 'abcdefghijklmnopqrstuvwxyz'
	rel = alphabet[:b]
	while len(rel) < a:
		rel += 'a'
	reps = int(n / a) + 1
	rel = rel * reps
	rel = rel[:n]
	print(rel)
t = int(input())
for i in range(t):
	solve()


for i in range(int(input())):
	(n, a, b) = map(int, input().split())
	s = []
	for i in range(a - b + 1):
		s.append('a')
	x = 'a'
	for i in range(b - 1):
		x = chr(ord(x) + 1)
		s.append(x)
	ans = []
	for i in range(n):
		ans.append(s[i % a])
	print(''.join(ans))


kl = int(input())
for l in range(kl):
	(n, a, b) = map(int, input().split())
	al = 'abcdefghijklmnopqrstuvwxyz'
	ck = n // b
	os = n % b
	rz = ''
	rz = al[:b] * ck + al[:os]
	print(rz)


T = int(input())
for _ in range(T):
	(n, a, b) = map(int, input().split())
	s = ''
	for i in range(97, 97 + b):
		s += chr(i)
	m = n // len(s)
	w = n % len(s)
	print(s * m + s[:w])


A = 'abcdefghijklmnopqrstuvwxyz'
for _ in range(int(input())):
	X = list(map(int, input().split()))
	Temp = ''
	for i in range(X[-1]):
		Temp += A[i]
	New = Temp * (X[1] // X[2]) + Temp[:X[1] % X[2]]
	Last = New * (X[0] // X[1]) + New[:X[0] % X[1]]
	print(Last)


t = int(input())
while t > 0:
	(n, a, b) = map(int, input().split())
	s1 = 'abcdefghijklmnopqrstuvwxyz'
	s2 = s1[:b]
	s3 = s2 * (n // b) + s2[:n % b]
	print(s3)
	t -= 1


l = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
t = int(input())
for _ in range(t):
	s = input().split(' ')
	n = int(s[0])
	a = int(s[1])
	b = int(s[2])
	ans = ''
	for i in range(b):
		ans += l[i]
	stri = ans
	while len(ans) < n:
		ans += stri
	print(ans[:n])


import math
s = 'abcdefghijklmnopqrstuvwxyz'
for t in range(int(input())):
	(n, a, b) = map(int, input().split())
	r = ''
	s1 = s[0:b]
	y = int(math.ceil(n / b))
	r = s1 * y
	r = r[0:n]
	print(r)


t = int(input())
import string
for i in range(t):
	c = ''
	(n, a, b) = [int(i) for i in input().split()]
	if n % b == 0:
		for j in range(n // b):
			c += string.ascii_lowercase[:b]
	else:
		for j in range(n // b):
			c += string.ascii_lowercase[:b]
		c += string.ascii_lowercase[:n % b]
	print(c)


k = 'abcdefghijklmnopqrstuvwxyz'
for j in range(int(input())):
	(n, a, b) = map(int, input().split())
	print(*k[:b] * (n // b), *k[:n % b], sep='')


testcases = int(input())
alph = [chr(i) for i in range(97, 123)]
for case in range(testcases):
	(n, a, b) = [int(zax) for zax in input().split()]
	s = []
	for i in range(n):
		ind = i % b
		s.append(alph[ind])
	print(''.join(s))


from string import ascii_lowercase
t = int(input())
out = ''
while t > 0:
	t -= 1
	(n, a, b) = [int(i) for i in input().split(' ')]
	usage = ascii_lowercase[:b]
	usage = (('a' * (a - b) + usage) * (n // a + 1))[:n]
	out += usage + '\n'
print(out)


for _ in range(int(input())):
	(n, a, b) = map(int, input().split())
	l = 'abcdefghijklmnopqrstuvwxyz'
	s = l[:b] * (n // b + 1)
	s = s[:n]
	print(s)


t = int(input())

def d(l, c):
	chars = [chr(ord('a') + i) for i in range(0, 26)]
	return chars[:c - 1] + [chars[c - 1]] * (l - c + 1)
for _ in range(t):
	(length, substrlen, distinct) = map(int, input().split())
	rep = d(substrlen, distinct)
	rep = rep * (length // substrlen + 1)
	print(''.join(rep[:length]))


import sys
t = int(sys.stdin.readline())
lets = 'abcdefghijklmnopqrstuvwxyz'
for _ in range(t):
	(n, a, b) = map(int, sys.stdin.readline().split())
	s = ''
	while len(s) < n:
		s += lets[:b]
	s = s[:n]
	print(s)


for _ in range(int(input())):
	(n, a, b) = list(map(int, input().split()))
	substring = []
	lastchar = chr(96)
	b2 = b
	for i in range(a):
		if b2 > 0:
			lastchar = chr(ord(lastchar) + 1)
		substring.append(lastchar)
		b2 -= 1
	substring = ''.join(substring)
	for i in range(n // a):
		print(substring, end='')
	remaining = n % a
	for i in range(remaining):
		print(substring[i], end='')
	print()


x = [chr(i) for i in range(ord('a'), ord('z') + 1)]
for _ in range(int(input())):
	(n, a, b) = map(int, input().split())
	bx = x[:b]
	result = []
	i = 0
	for _ in range(n):
		if i == b:
			i = 0
		result.append(bx[i])
		i += 1
	print(*result, sep='')


t = int(input())
for i in range(0, t):
	(n, a, b) = map(int, input().split())
	s = ''
	for i in range(0, b):
		if i == 0:
			s += 'a'
		else:
			s = s + chr(ord(s[i - 1]) + 1)
	s = s * (a // b)
	faltu = a - b * (a // b)
	s = s + s[:faltu]
	ans = s * (n // a)
	faltu = n - a * (n // a)
	ans += s[:faltu]
	print(ans)


import math

def f(s):
	for i in range(1, len(s)):
		if s[i] != s[i - 1]:
			return False
	return True
t = int(input())
bal = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
for i in range(t):
	ans = []
	(n, a, b) = map(int, input().split())
	for i in range(n):
		ans.append(1 + i % b)
	for l in range(n):
		print(bal[ans[l] - 1], end='')
	print()


t = int(input())
for i in range(t):
	(n, a, b) = map(int, input().split())
	st = ''
	k = 0
	while k < n:
		for j in range(b):
			st = st + chr(97 + j)
			k = k + 1
			if k == n:
				break
	print(st)


for _ in range(int(input())):
	(n, a, b) = map(int, input().split())
	s = 'abcdefghijklmnopqrstuvwxyz'
	if n == a:
		print(s[0:b] + 'a' * (a - b))
	else:
		p = s[0:b] + 'a' * (a - b)
		c = n // a
		print(p * c + p[0:n - a * c])


t = int(input())
while t:
	(n, a, b) = map(int, input().strip().split())
	x = 97
	c = ''
	while n:
		c += chr(x)
		x += 1
		n -= 1
		if x == 97 + b:
			x = 97
	print(c)
	t -= 1


from sys import stdin
t = int(stdin.readline().strip())
for line in stdin.readlines():
	(n, a, b) = map(int, line.split())
	s = []
	for i in range(n):
		s.append(chr(ord('a') + i % b))
	print(''.join(s))


for i in range(int(input())):
	(n, a, b) = map(int, input().split())
	s = [chr(97 + i % b) for i in range(n)]
	print(*s, sep='')


import sys

def solve(n, a, b, alphabet):
	return (alphabet[:b] * (n // b + 1))[:n]
t = int(input())
alphabet = ''.join([chr(x) for x in range(ord('a'), ord('z') + 1)])
for _ in range(t):
	[n, a, b] = [int(x) for x in sys.stdin.readline().split(' ')]
	print(solve(n, a, b, alphabet))


t = int(input())
ans = []
for _ in range(1, t + 1):
	(n, a, b) = map(int, input().split())
	s = 97
	d = ''
	for i in range(b):
		d = d + chr(s)
		s = s + 1
	st = n // b * d + ''.join(d[:n % b])
	ans.append(st)
for i in ans:
	print(i)


import sys
t = int(input())
A = 'abcdefghilmnopqrstuvzxyjkw'
for x in range(t):
	(n, a, b) = map(int, input().split())
	u = 7 // a
	s = ''
	for y in range(b):
		s += A[y]
	u = n // len(s)
	q = n % len(s)
	s += s * (u - 1)
	for y in range(q):
		s += A[y]
	print(s)


for i in range(int(input())):
	(n, a, b) = map(int, input().split())
	s = ''
	k = 97
	while n != 0:
		s += chr(k)
		if k != b + 96:
			k += 1
		else:
			k = 97
		n -= 1
	print(s)


t = int(input())

def solve(n, a, b):
	s = ''
	i = 0
	for j in range(0, n):
		s += chr(ord('a') + i)
		i += 1
		i %= b
	return s
while t > 0:
	(n, a, b) = map(int, input().split(' '))
	res = solve(n, a, b)
	print(res)
	t -= 1


from sys import stdin, stdout
import math
n = int(stdin.readline())
for i in range(n):
	(t, a, b) = [int(x) for x in stdin.readline().split()]
	strr = ''
	for i in range(b):
		strr += chr(97 + i)
	for i in range(a - b):
		strr += chr(97)
	strr1 = ''
	for i in range(int(t / a)):
		strr1 += strr
	for i in range(t % a):
		strr1 += strr[i]
	stdout.write(strr1 + '\n')


def solve():
	alfavit = 'qwertyuiopasdfghjklzxcvbnm'
	(n, a, b) = map(int, input().split())
	ans = ''
	i = 0
	while len(ans) != n:
		ans += alfavit[i]
		i += 1
		if i == b:
			i = 0
	print(ans)
t = int(input())
for i in range(t):
	solve()


for _ in range(int(input())):
	(n, sub, dis) = map(int, input().split())
	string = ''
	alpha = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
	k = 0
	for i in range(dis):
		string += alpha[i]
	for i in range(sub - dis):
		string += string[-1]
	for i in range(n - sub):
		string += string[i]
	print(string)


m = 'abcdefghijklmnopqrstuvwxyz'
t = int(input())
for i in range(t):
	IN = input()
	a = IN.split()
	for j in range(3):
		a[j] = int(a[j])
	k = 0
	for j in range(a[0]):
		print(m[k % a[2]], end='')
		k = k + 1
	print()


for _ in range(int(input())):
	start = 97
	(n, a, b) = map(int, input().split())
	temp = 0
	s = []
	for i in range(n):
		if temp < b:
			s.append(chr(start + temp))
		else:
			temp = 0
			s.append(chr(temp + start))
		temp += 1
	print(''.join(s))


t = int(input())
for _ in range(t):
	(n, a, b) = list(map(int, input().strip().split()))
	char = 97
	s = ''
	for i in range(b):
		s += chr(char)
		char += 1
	char -= 1
	for i in range(a - b):
		s += chr(char)
	j = 0
	for i in range(n - a):
		j = j % a
		s += s[j]
		j += 1
	print(s)


import string
A = string.ascii_lowercase
for _ in range(int(input())):
	(n, a, b) = map(int, input().split())
	i = 0
	while n > 0:
		print(A[:min(b, n)], end='')
		n -= b
	print()


def solve(n, a, b):
	alphabet = [chr(97 + i) for i in range(26)]
	ret = ['' for _ in range(n)]
	for i in range(n):
		ret[i] = alphabet[i % b]
	return ''.join(ret)
t = int(input())
for i in range(t):
	nab = input().split()
	n = int(nab[0])
	a = int(nab[1])
	b = int(nab[2])
	print(solve(n, a, b))


t = int(input())
for _ in range(t):
	(n, a, b) = map(int, input().split())
	string = ['a' for x in range(a)]
	last = a - 1
	temp = b - 1
	while temp:
		string[last] = chr(temp + 97)
		last -= 1
		temp -= 1
	rep = (n + a - 1) // a
	ans = []
	for x in range(rep):
		ans.extend(string)
	print(''.join(ans[:n]))


ch1 = int(input())
m = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
for x in range(ch1):
	(n, h, j) = map(int, input().split())
	s = ''
	ch = 0
	for i in range(j):
		s += m[i]
		ch = i
	s = s * (n // j)
	k = n - n // j * j
	ch += 1
	for i in range(k):
		s += m[ch % j]
		ch += 1
	print(s)


t = int(input())
for i in range(t):
	(n, a, b) = input().strip().split(' ')
	(n, a, b) = [int(n), int(a), int(b)]
	x = ''
	for j in range(b):
		x += chr(97 + j)
	f = ''
	for j in range(n):
		f += x[j % b]
	print(f)


for _ in range(int(input())):
	(n, a, b) = map(int, input().split())
	ans = [-1] * n
	for i in range(n):
		ans[i] = chr(97 + i % b)
	print(''.join(ans))


s = 'qwertyuiopasdfghjklzxcvbnm'
for i in range(int(input())):
	(n, a, b) = [int(s) for s in input().split()]
	sub = s[:b]
	string = s[:b] * (n + 1)
	print(string[:n])


t = int(input())
alpha = 'abcdefghijklmnopqrstuvwxyz'
for _ in range(t):
	(n, a, b) = map(int, input().split())
	ans = [''] * n
	tmp = alpha[:b]
	for i in range(n):
		ans.append(tmp[i % b])
	print(''.join(ans))


t = int(input())
for _ in range(t):
	(n, a, b) = list(map(int, input().split()))
	c = 'abcdefghijklmnopqrstuvwxyz'
	d = c[:b]
	print(d * (n // b) + d[:n % b])


t = int(input())
for _ in range(t):
	(n, ax, b) = map(int, input().split())
	s = ''
	t = ''
	for i in range(ax - b + 1):
		s += 'a'
	for i in range(b - 1):
		s += chr(ord('a') + i + 1)
	for i in range(n):
		t += s[i % ax]
	print(t)


t = int(input())
for _ in range(t):
	(n, a, b) = map(int, input().split())
	s = 'abcdefghijklmnopqrstuvwxyz'
	c = s[:b]
	m = n // b + 1
	c = c * m
	print(c[:n])


def count():
	alphabet = 'abcdefghijklmnopqrstuvwxyz'
	(n, a, b) = list(map(int, input().split(' ')))
	print(alphabet[:b] * (n // b) + alphabet[:n - b * (n // b)])
for _ in range(int(input())):
	count()


t = int(input())
for z in range(t):
	(n, a, b) = map(int, input().split())
	s = ''
	for i in range(n):
		s += chr(ord('a') + i % b)
	print(s)


t = int(input())
for i in range(t):
	(n, a, b) = input().split()
	a = int(a)
	b = min(int(b), a)
	n = int(n)
	count = 1
	string = ['a' for i in range(n)]
	for i in range(1, n):
		if count == b:
			count = 1
			continue
		string[i] = chr(ord(string[i]) + count)
		count += 1
	print(''.join(string))


import math
testCases = int(input())
for _ in range(testCases):
	(n, a, b) = [int(x) for x in input().split()]
	answer = ''
	for index in range(n):
		answer += chr(97 + index % b)
	print(answer)


alpha = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
cases = int(input())
for i in range(cases):
	(a, b, c) = map(int, input().split())
	counter = 0
	key = ''
	for j in range(c):
		key += alpha[j]
	while len(key) < b:
		if counter < c:
			key += key[counter]
			counter += 1
		else:
			counter = 0
	counter = 0
	while len(key) < a:
		if counter < b:
			key += key[counter]
			counter += 1
		else:
			counter = 0
	print(key)


def main():
	cases = int(input())
	for case in range(cases):
		(n, a, b) = map(int, input().split())
		print(''.join([chr((i - 97) % b + 97) for i in range(97, 97 + n)]))
main()


for _ in range(int(input())):
	(n, a, b) = map(int, input().split())
	q = []
	for i in range(97, 97 + b):
		q.append(chr(i))
	i = 0
	while i * b < n:
		i += 1
	if b * i == n:
		w = q * i
		print(''.join(w))
	else:
		w = q * (i - 1)
		w += q[:n - (i - 1) * b]
		print(''.join(w))


t = int(input(''))
alp = 'abcdefghijklmnopqrstuvwxyz'
for i in range(t):
	(n, a, b) = list(map(int, input('').split(' ')))
	list1 = [alp[j] for j in range(b)]
	list2 = [alp[b - 1] for j in range(a - b)]
	list1.extend(list2)
	ans = ''
	for j in range(len(list1)):
		ans += list1[j]
	x = n // a
	ans = ans * x
	for j in range(n - x * a):
		ans += list1[j]
	print(ans)


t = int(input())
res = ''
alph = 'qwertyuiopasdfghjklzxcvbnm'
for _ in range(t):
	(n, a, b) = map(int, input().split())
	sub_str = alph[:b] + alph[b - 1] * (a - b)
	sub_str = sub_str * (n // a + 1)
	res += sub_str[:n] + '\n'
print(res)


def answer(n, a, b):
	alpha = 'abcdefghijklmnopqrstuvwxyz'
	loop = alpha[0:b]
	if a // len(loop) >= 1:
		temp = loop
		loop = loop * (a // len(loop))
		loop += ''.join([temp[i] for i in range(0, a % len(temp))])
	else:
		loop += ''.join([loop[i] for i in range(0, a - len(loop))])
	s = ''
	if n // len(loop) >= 1:
		s = loop * (n // len(loop))
	return s + ''.join([loop[i] for i in range(0, n % len(loop))])
testCount = int(input())
for _ in range(testCount):
	(n, a, b) = map(int, input().split())
	print(answer(n, a, b))


t = int(input())
for _ in range(t):
	(n, a, b) = map(int, input().split())
	s = ''
	d = 'abcdefghijklmnopqrstuvwxyz'
	di = [i for i in d]
	di = d[:b]
	for i in range(n):
		s += d[i % len(di)]
	print(s)


import sys
import math
input = lambda : sys.stdin.readline().strip()
t = int(input())

def check(s, a, b):
	for i in range(len(s) - a):
		c = set()
		for j in range(a):
			c.add(s[i + j])
		if len(c) != b:
			return False
	return True
while t:
	t -= 1
	(n, a, b) = map(int, input().split())
	temp = ''
	for i in range(b):
		temp += chr(ord('a') + i)
	temp = temp + 'a' * (a - len(temp))
	ans = ''
	while len(ans) + len(temp) < n:
		ans += temp
	ans += temp[:n - len(ans)]
	print(ans)


t = int(input())
for q in range(t):
	(n, a, b) = map(int, input().split())
	i = ord('a')
	e = ''
	for j in range(b):
		e += chr(i)
		i += 1
	for j in range(a - b):
		e += 'a'
	ans = ''
	i = 0
	j = 0
	while j < n:
		ans += e[i]
		i += 1
		if i == a:
			i = 0
		j += 1
	print(ans)


t = int(input())
alph = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
alph = alph.lower()
for x in range(t):
	(n, a, b) = list(map(int, input().split()))
	res = ''
	for j in range(n // b):
		for i in range(b):
			res += alph[i]
	for i in range(n % b):
		res += alph[i]
	print(res)


t = int(input())
for _ in range(t):
	(n, a, b) = list(map(int, input().split()))
	k = b
	i = 0
	s = ''
	while k > 0:
		s += chr(97 + i)
		i = i + 1
		k = k - 1
	s = s + s[-1] * (a - b)
	s = s * (n // a)
	s = s + s[:n % a]
	print(s)


alpha = 'abcdefghijklmnopqrstuvwxyz'
t = int(input())
for testcase in range(t):
	(n, a, b) = map(int, input().split())
	r = n // b
	k = n % b
	word = alpha[0:b] * r
	word += alpha[0:k]
	print(word)


t = int(input())
alpha = ['b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
for _ in range(t):
	(n, a, b) = map(int, input().split())
	repeat = a - b + 1
	initial = 'a' * repeat
	for i in range(b - 1):
		initial += alpha[i]
	for i in range(n):
		print(initial[i % a], end='')
	print()


t = int(input())
for test in range(t):
	(n, a, b) = map(int, input().split())
	s = ''
	count = 0
	for i in range(a):
		s += chr(97 + count)
		if count < b - 1:
			count += 1
	for i in range(n - a):
		s += s[i]
	print(s)


for t in range(int(input())):
	(n, a, b) = (int(x) for x in input().split())
	substr = 'abcdefghijklmnopqrstuvwxyz'[:b]
	print(substr * (n // b) + substr[:n % b])


t = int(input())
for f in range(t):
	(n, a, b) = input().split()
	n = int(n)
	a = int(a)
	b = int(b)
	abc = 'qwertyuiopasdfghjklzxcvbnm'
	i = 0
	while i < n:
		print(abc[i % b], end='')
		i += 1
	print()


import sys
input = sys.stdin.readline

def getInt():
	return int(input())

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

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

def getStr():
	return input().strip()
t = getInt()
for _ in range(t):
	(n, a, b) = getVars()
	s = ''
	for i in range(ord('a'), ord('a') + b):
		s += chr(i)
	s = s * (n // b + 1)
	s = s[:n]
	print(s)


t = int(input())
sss = 'abcdefghijklmnopqrstuvwxyz'
for i in range(t):
	(n, a, b) = map(int, input().split())
	s = sss[:b]
	if n % b == 0:
		ans = s * (n // b)
	else:
		ans = s * (n // b) + s[:n % b]
	print(ans)


k = int(input())
for i in range(k):
	(n, a, b) = input().split()
	temp = 'a'
	strr = ''
	for i in range(int(b) - 1):
		strr += temp
		temp = chr(ord(temp) + 1)
	for i in range(int(b), int(a) + 1):
		strr += temp
	ii = 0
	for i in range(int(a), int(n)):
		strr += strr[ii]
		ii += 1
	print(strr)


import string
p = int(input())
while p > 0:
	p -= 1
	ls = list()
	na = input()
	x = na.split()
	n = int(x[0])
	a = int(x[1])
	b = int(x[2])
	for i in range(0, n):
		ls.append(chr(97 + i % b))
	print(''.join([str(x) for x in ls]))


mod = 10 ** 9 + 7
import math
from bisect import bisect_left
from collections import Counter
from itertools import combinations

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

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

def mc2(s):
	return s * (s - 1) // 2 + s

def count(n):
	i = 2
	c = 0
	while i <= math.sqrt(n):
		while n % i == 0:
			c += 1
			n /= i
		i = i + 1
	if n > 2:
		c += 1
	return max(c, 1)
for tc in range(int(input())):
	(n, a, b) = ain()
	s = ''
	for i in range(b):
		s += chr(97 + i)
	s = s * (a // b) + s[:a % b]
	for i in range(n):
		print(s[i % a], end='')
	print()


from string import ascii_lowercase
letters = ascii_lowercase
queries = int(input())
for _ in range(queries):
	(n, s_len, unique) = map(int, input().split())
	result = letters[:unique]
	result += 'a' * (s_len - len(result))
	while len(result) < n:
		result += result
	print(result[:n])


(t, *L) = map(int, open(0).read().split())
ans = []
s = 'qwertyuiopasdfghjklzxcvbnm'
for (n, a, b) in zip(*[iter(L)] * 3):
	x = s[:b] + s[b - 1] * max(0, a - b)
	y = x * (n // a + 1)
	ans.append(y[:n])
print('\n'.join(ans))


for _ in range(int(input())):
	s = 'qwertyuiopasdfghjklzxcvbnm'
	(n, a, b) = map(int, input().split())
	if b < 26:
		s = s[:b]
	else:
		b = 26
	q = int(a / b)
	r = a % b
	s = q * s + s[:r]
	q = int(n / a)
	r = n % a
	s = q * s + s[:r]
	print(s)


t = int(input())
for _ in range(t):
	(n, a, b) = list(map(int, input().split()))
	letters = [chr(ord('a') + i) for i in range(b)]
	for j in range(n):
		print(letters[j % b], end='')
	print()


t = int(input())
while t > 0:
	t -= 1
	(n, a, b) = map(int, input().split())
	for i in range(n):
		print(chr(97 + i % b), end='')
	print(end='\n')


t = int(input())
from string import ascii_letters
for _ in range(t):
	(n, a, b) = map(int, input().split(' '))
	pattern = ascii_letters[:b]
	res = ''
	i = 0
	while len(res) < n:
		res += pattern[i]
		i = (i + 1) % b
	print(res)


import sys
t = int(sys.stdin.readline())
for _ in range(t):
	(n, a, b) = map(int, sys.stdin.readline().split())
	s = ''
	c = ''
	for i in range(b):
		s += chr(97 + i)
		c += chr(97 + i)
	j = 0
	for i in range(n - b):
		s += c[j]
		if j == len(c) - 1:
			j = 0
		else:
			j += 1
	print(s)


t = int(input())
s = ''
for i in range(97, 123):
	s += chr(i)
for i in range(t):
	(n, a, b) = map(int, input().split())
	l = s[:b]
	k = n // b
	print(l * k, end='')
	print(s[:n % b], end='')
	print()


for t in range(int(input())):
	alp = '#abcdefghijklmnopqrstuvwxyz'
	(n, a, b) = map(int, input().split())
	ans = ''
	(i, j) = (1, 0)
	while j < n:
		ans += alp[i]
		i += 1
		if i > b:
			i = 1
		j += 1
	print(ans)


t = int(input())
for k in range(t):
	(n, a, b) = map(int, input().split())
	s = ''
	for i in range(a):
		s += chr(97 + i % b)
	for i in range(1, n - a + 1):
		s += s[i - 1:i]
	print(s)


t = int(input())
for _ in range(t):
	(n, a, b) = map(int, input().split())
	alpha = [chr(ord('a') + i) for i in range(b)]
	res = ''
	for i in range(n):
		res += alpha[i % b]
	print(res)


t = int(input())
charset = 'qwertyuiopasdfghjklzxcvbnm'
for i in range(t):
	(n, a, b) = map(int, input().split())
	unique_set = charset[:b]
	res = ''
	while len(res) <= n:
		res += unique_set
	print(res[:n])


T = int(input(''))
for _ in range(T):
	(n, a, b) = map(int, input().split())
	ar = 'abcdefghijklmnopqrstuvwxyz'
	k = ''
	for i in range(n):
		k = k + ar[0:b]
	print(k[0:n])


A = 'abcdefghilmnopqrstuvzxyjkw'
T = int(input())
for t in range(T):
	(n, a, b) = map(int, input().split())
	s = ''
	s = A[0:b]
	s = s * (n // b + 1)
	s = s[:n]
	print(s)


for i in range(int(input())):
	(n, a, b) = map(int, input().split())
	print(('abcdefghijklmnopqrstuvwxyz'[:b] * n)[:n])


t = int(input())
for i in range(t):
	(n, a, b) = map(int, input().split())
	ans = ''
	temp = ord('a')
	l = []
	for j in range(b):
		l.append(chr(temp + j))
	curr = ''
	len_ans = 0
	for j in range(n):
		if len_ans < b:
			ans += l[len_ans]
			len_ans += 1
		elif len_ans < a:
			ans += ans[-1]
			len_ans += 1
		else:
			ans += ans[-a]
	print(ans)


t = int(input())
while t:
	t -= 1
	s = input()
	s = s.split(' ')
	(n, a, b) = (int(s[0]), int(s[1]), int(s[2]))
	di = {}
	ans = ['-1'] * n
	c = 0
	for i in range(a):
		ans[i] = c
		if c in di.keys():
			di[c] += 1
		else:
			di[c] = 1
		c += 1
		if c >= b:
			c = b - 1
	for i in range(a, n):
		if di[ans[i - a]] == 1:
			ans[i] = ans[i - a]
		else:
			di[ans[i - a]] -= 1
			ans[i] = ans[i - a]
	for i in range(len(ans)):
		ans[i] = chr(97 + ans[i])
	print(''.join(ans))


t = int(input())
for _ in range(t):
	(n, a, b) = list(map(int, input().rstrip().split()))
	ex = 'abcdefghijklmnopqrstuvwxyz'
	ans = ex[:b]
	tmp = ans[:]
	i = 0
	while len(tmp) != a:
		tmp += ans[i]
		i += 1
		if i == len(ans):
			i = 0
	ans = tmp[:]
	j = 0
	while len(ans) != n:
		ans += tmp[j]
		j += 1
		if j == len(tmp):
			j = 0
	print(ans)


for ekbaar in range(1):
	for tin in range(int(input())):
		(n, a, b) = map(int, input().split())
		s = 'abcdefghijklmnopqrstuvwxyz'
		x = s[:b] * (n // b + 1)
		print(x[:n])


import string
w = int(input())
for x in range(w):
	d = [int(x) for x in input().split(' ')]
	ans = ''
	for y in range(d[2]):
		ans += string.ascii_lowercase[y]
	if d[1] == d[2] and d[1] == 1:
		ans = ''.join(string.ascii_lowercase[:d[0]])
	for y in range(d[0]):
		if len(ans) == d[0]:
			break
		ans += ans[y]
	print(ans)


from string import ascii_letters
letters = ascii_letters[:len(ascii_letters) // 2]
t = int(input())
for _ in range(t):
	(n, a, b) = map(int, input().split())
	origin = list(letters[0] * (a - b)) + [letters[i] for i in range(b)]
	for i in range(n):
		print(origin[i % a], end='')
	print()


t = int(input())
s = 'abcdefghijklmnopqrstuvwxyz'
while t > 0:
	(n, a, b) = map(int, input().split())
	q = s[:b] * (n // b + 1)
	print(q[:n])
	t -= 1


for _ in range(int(input())):
	(n, a, b) = map(int, input().split())
	x = []
	for i in range(97, 97 + b):
		x.append(chr(i))
	y = ''.join(x)
	z = list((n - len(x)) // len(x) * str(y))
	i = 0
	while i < (n - len(x)) % len(x):
		z.append(x[i])
		i += 1
	print(''.join(x + z))


from functools import reduce
import sys

class Read:

	@staticmethod
	def string():
		return input()

	@staticmethod
	def int():
		return int(input())

	@staticmethod
	def list(delimiter=' '):
		return input().split(delimiter)

	@staticmethod
	def list_int(delimiter=' '):
		return list(map(int, input().split(delimiter)))
import string

def main():
	alf = string.ascii_lowercase
	t = Read.int()
	for _ in range(t):
		(n, a, b) = Read.list_int()
		sres = alf[:b]
		res = ''
		i = 0
		while i < n:
			ff = b if n - i > b else n - i
			res += sres[:ff]
			i += b
		print(res)
main()


import string
alpha = list(string.ascii_lowercase)
t = int(input())
for i in range(t):
	f = lambda : map(int, input().split())
	(n, a, b) = f()
	ch = ''
	j = 0
	while j < n:
		ch2 = ''
		k = 0
		while k < a and j < n:
			ch2 += alpha[k]
			k += 1
			j += 1
			if k == b:
				k = 0
		ch += ch2
	print(ch)


t = int(input())
st = 'abcdefghijklmnopqrstuvwxyz'
for i in range(t):
	(n, a, b) = map(int, input().split())
	s = []
	base = st[:b] + st[b - 1] * (a - b)
	s = ''.join([base for i in range((n + a - 1) // a)])
	print(s[:n])


INT_MAX = 10 ** 18 + 7
x = 10 ** 9 + 7

def INPUT():
	return list((int(i) for i in input().split()))

def LIST_1D_ARRAY(n):
	return [0 for _ in range(n)]

def LIST_2D_ARRAY(m, n):
	return [[0 for _ in range(n)] for _ in range(m)]
s = 'abcdefghijklmnopqrstuvwxyz'
for _ in range(int(input())):
	(L, A, B) = INPUT()
	x = s[0:B]
	ans = ''
	ans += x * (L // B)
	r = L % B
	ans += s[0:r]
	print(ans)


import math
from collections import Counter
for _ in range(int(input())):
	(a, b, c) = map(int, input().split())
	count = 0
	string = []
	for i in range(b):
		string.append(chr(count + 97))
		count += 1
		if count >= c - 1:
			count = c - 1
	for i in range(a - b):
		string.append(string[-b])
	print(''.join(string))


t = int(input())
for _ in range(t):
	(n, a, b) = map(int, input().split())
	asc = [i for i in range(97, 123)]
	ans = []
	for i in range(n):
		ans.append(chr(asc[i % b]))
	print(''.join(ans))


alph = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
import math
for _ in range(int(input())):
	(n, a, b) = list(map(int, input().split()))
	strOut = ''.join(alph[:b])
	pre = strOut * math.floor(n / b)
	print(pre + strOut[:n - math.floor(n / b) * b])


from math import *
from bisect import bisect_left, bisect_right
from queue import Queue
from sys import stdin, stdout
from collections import Counter
input = lambda : stdin.readline().strip()
fast_print = stdout.write
t = int(input())
for _ in range(t):
	(n, a, b) = map(int, input().split())
	s = 'a' * (a - b + 1)
	for i in range(b - 1):
		s += chr(ord('a') + i + 1)
	for i in range(n - a):
		s += s[i]
	fast_print(s + '\n')


n = int(input())
chars = 'abcdefghijklmnopqrstuvwxyz'
for i in range(n):
	(x, a, b) = list(map(int, input().split()))
	use = chars[:b]
	ans = ''
	while len(ans) < x:
		ans += use
	if len(ans) > x:
		ans = ans[:x]
	print(ans)


hm = int(input())
for _ in range(hm):
	(lent, subs, uni) = map(int, input().split())
	strr = ''
	res = ''
	for i in range(uni):
		n = 97 + i
		ch = chr(n)
		strr += ch
	for i in range(int(lent / uni) + 1):
		res += strr
	print(res[:lent])


t = int(input())
for i in range(0, t):
	(a, b, c) = map(int, input().split())
	s = 'abcdefghijklmnopqrstuvwxyz'
	l = ''
	l = s[0:c] * (a // c) + s[0:a % c]
	print(l)


alph = 'abcdefghijklmnopqrstuvwxyz'
gi = lambda : list(map(int, input().split()))
for _ in range(gi()[0]):
	(n, a, b) = gi()
	print((alph[:b] * (n // b + 1))[:n])


import sys
input = sys.stdin.readline
t = int(input())
al = 'abcdefghijklmnopqrstuvwxyz'
for _ in range(t):
	(n, a, b) = [int(x) for x in input().split()]
	s = list(al[:b])
	s_ = list(['a'] * (a - b))
	s = s_ + s
	k = 0
	for i in range(n):
		if i < a:
			continue
		s.append(s[k])
		k += 1
	print(''.join(s))


t = int(input())
for i in range(t):
	(n, a, b) = list(map(int, input().split()))
	alpha = 'abcdefghijklmnopqrstuvwxyz'
	used_letters = alpha[:b]
	start_str = used_letters[0] * (a - len(used_letters)) + used_letters
	while len(start_str) != n:
		start_str += start_str[-a]
	print(start_str)


for _ in range(int(input())):
	(n, a, b) = map(int, input().split())
	s = []
	for i in range(b):
		s.append(chr(97 + i))
	for i in range(a - b):
		s.append(chr(97 + b - 1))
	d = []
	while len(d) < n:
		d = d + s
	ans = d[:n]
	print(''.join(ans))


t = int(input())
for i in range(t):
	(n, a, b) = map(int, input().split())
	v = a - b + 1
	s = 'a' * v
	for j in range(b - 1):
		s += chr(98 + j)
	vi = n // a
	st = s * vi + s[0:n % a]
	print(st)


t = int(input(''))
for _ in range(t):
	[n, a, b] = list(map(int, input().split()))
	ans = ''
	for i in range(n):
		ans += chr(97 + i % b)
	print(ans)


def solve(n, a, b):
	l = []
	t = []
	for i in range(b):
		l.append(chr(ord('a') + i))
	t.extend(l)
	for i in range(n // b - 1):
		l.extend(t)
	if n % b != 0:
		for i in range(n % b):
			l.append(t[i])
	print(''.join(l))
t = int(input())
for i in range(t):
	(n, a, b) = map(int, input().split())
	solve(n, a, b)


def _in():
	return [int(x) for x in input().split(' ')]
s = 'abcdefghijklmnopqrstuvwxyz'
for t in range(int(input())):
	(n, a, b) = _in()
	out = s[:b]
	while len(out) < a:
		out = out + out[-1]
	while len(out) < n:
		temp = set(out[1 - a:])
		m = len(temp)
		if m != b:
			for i in s:
				if not i in temp:
					out = out + i
					break
		else:
			out = out + out[-1]
	print(out)


class Solution:

	def strings(self, n, a, b):
		start = 'a'
		l = 0
		s = ''
		for i in range(b):
			s += chr(ord(start) + i)
		res = ''
		while len(s) < a:
			s += s[-1]
		for i in range(n):
			res += s[i % a]
		return res

	def solve(self):
		t = int(input())
		for i in range(t):
			line = input().split(' ')
			n = int(line[0])
			a = int(line[1])
			b = int(line[2])
			print(self.strings(n, a, b))
Solution().solve()


t = int(input())
alphabet = ''
for x in range(ord('a'), ord('z') + 1):
	alphabet = alphabet + chr(x)
while t > 0:
	(_n, _a, _b) = input().split(' ')
	(n, a, b) = (int(_n), int(_a), int(_b))
	sub = alphabet[:b]
	print(sub * (n // b) + sub[:n % b])
	t -= 1


T = int(input())
s = 'abcdefghijklmnopqrstuvwxyz'
for _ in range(T):
	(n, a, b) = map(int, input().split())
	i = 0
	while i < n:
		for j in range(b):
			print(s[j], end='')
			i += 1
			if i == n:
				break
	print('')


t = int(input())
s = 'abcdefghijklmnopqrstuvwxyz'
for _ in range(t):
	(n, a, b) = [int(x) for x in input().strip().split()]
	curr = s[:b]
	res = curr * ((n // b + 1) * b)
	res = res[:n]
	print(res)


import math
x = int(input(''))
for i in range(x):
	(n, a, b) = list(map(int, input('').split(' ')))
	ans = []
	alphabet = ['q', 'w', 'e', 'r', 't', 'y', 'u', 'i', 'o', 'p', 'a', 's', 'd', 'f', 'g', 'h', 'j', 'k', 'l', 'z', 'x', 'c', 'v', 'b', 'n', 'm']
	while len(ans) < n:
		for i in range(b):
			if len(ans) < n:
				ans.append(alphabet[i])
	print(''.join(ans))


def solve(n, a, b):
	ans = ''
	for i in range(a):
		ans = ans + chr(97 + i % b)
	for i in range(n - a):
		ans += chr(97 + i % b)
	print(ans)
for i in range(int(input())):
	(n, a, b) = map(int, input().split())
	solve(n, a, b)


t = int(input())
for i in range(t):
	s = input().split()
	n = int(s[0])
	a = int(s[1])
	b = int(s[2])
	if b == 1:
		for k in range(n):
			print('a', end='')
		print('')
		continue
	count = 0
	while count < n:
		x = 97
		for k in range(b):
			print(chr(x), end='')
			x += 1
			count += 1
			if count == n:
				break
		if count == n:
			break
		for l in range(b, a):
			print(chr(x - 1), end='')
			count += 1
			if count == n:
				break
	print('')


import sys
import string
input = sys.stdin.readline
for tt in range(int(input())):
	(n, a, b) = map(int, input().split())
	s = string.ascii_lowercase
	l = []
	for i in range(b):
		l.append(s[i])
	temp = l[-1]
	for i in range(a - b):
		l.append(temp)
	for i in range(n - a):
		l.append(l[i])
	print(''.join(l))


t = int(input())

def solve(n, a, b):
	ans = []
	c = 0
	for i in range(0, n):
		ans.append(chr(97 + c))
		c += 1
		c %= b
	return ''.join(ans)
for _ in range(0, t):
	(n, a, b) = list(map(int, input().split()))
	soln = solve(n, a, b)
	print(soln)


import string
for _ in range(int(input())):
	(n, a, b) = map(int, input().split())
	t = n // b
	ans = ''
	alpha = string.ascii_lowercase
	while t > 0:
		ans += alpha[0:b]
		t -= 1
	ans += alpha[0:n - len(ans)]
	print(ans)


t = int(input())
for i in range(0, t):
	nab = input().split()
	n = int(nab[0])
	a = int(nab[1])
	b = int(nab[2])
	char = 'a'
	substring = ''
	index = 0
	a2 = a
	while a:
		if b:
			substring += char
			char = chr(ord(char) + 1)
			b -= 1
		else:
			substring += substring[index]
			index += 1
		a -= 1
	output = ''
	full = int(n / a2)
	rem = int(n % a2)
	while full:
		output += substring
		full -= 1
	for l in range(0, rem):
		output += substring[l]
	print(output)


for t in range(int(input())):
	(n, a, b) = (int(i) for i in input().split())
	substring = ''
	for i in range(b):
		substring += chr(i + 97)
	subs = substring[:n % b]
	substring *= n // b
	substring += subs
	print(substring)


t = int(input())
l = []
alpha = 'a'
for i in range(0, 26):
	l.append(alpha)
	alpha = chr(ord(alpha) + 1)
while t:
	t = t - 1
	(n, a, b) = map(int, input().split())
	temp = ''
	for i in range(b):
		temp += l[i]
	while len(temp) < n:
		temp += temp
	print(temp[:n])


import string
ss = string.ascii_lowercase
for _ in [0] * int(input()):
	(n, a, b) = map(int, input().split())
	ans = ''
	for i in range(n):
		ans += ss[(i + 1) % b]
	print(ans)


alphabet = 'abcdefghijklmnopqrstuvwxyz'
for case in range(int(input())):
	(n, a, b) = [int(s) for s in input().split(' ')]
	string = ''
	while len(string) != n:
		for val in range(0, a, b):
			for b_letters in range(b):
				if len(string) != n:
					string += alphabet[b_letters]
		string = string[:n]
	print(string)


t = int(input())
for i in range(t):
	data = input().split()
	n = int(data[0])
	a = int(data[1])
	b = int(data[2])
	s = ''
	while len(s) < n:
		for h in range(a):
			s += chr(ord('a') + h % b)
	print(s[:n])


import math
t = int(input())
for _ in range(t):
	(n, a, b) = [int(i) for i in input().split()]
	if a == b:
		st = ''
		for i in range(min(26, n)):
			st += chr(i + ord('a'))
		st = st * int(n / 26) + st[:n % 26]
		print(st)
	elif b == 1:
		print('a' * n)
	else:
		st = ''
		for i in range(b):
			st += chr(i + ord('a'))
		st1 = st + st[0:a - b]
		st = st1 * int(n / len(st1)) + st1[:n % len(st1)]
		print(st)


for i in range(int(input())):
	(n, a, b) = list(map(int, input().split()))
	ans = ''
	for j in range(b):
		ans += chr(ord('a') + j)
	for j in range(a - b):
		ans += ans[-1]
	for j in range(a, n):
		ans += ans[j - a]
	print(ans)


import math
w = 'abcdefghijklmnopqrstuvwxyz'
T = int(input())
for t in range(T):
	(N, A, B) = list(map(int, input().split()))
	counter = 0
	word = ''
	for i in range(A):
		word += w[counter]
		if counter < B - 1:
			counter += 1
	nCounter = A
	helper = 0
	while nCounter < N:
		word += word[helper]
		nCounter += 1
		helper += 1
	print(word)


from collections import defaultdict
import sys
from functools import reduce, cmp_to_key
from collections import deque
import threading
from itertools import combinations

def input():
	return sys.stdin.readline().strip()

def iinput():
	return int(input())

def tinput():
	return input().split()

def rinput():
	return map(int, tinput())

def rlinput():
	return list(rinput())

def factors(n):
	return set(reduce(list.__add__, ([i, n // i] for i in range(1, int(n ** 0.5) + 1) if n % i == 0)))
for _ in range(iinput()):
	(n, a, b) = rinput()
	s = ''
	for i in range(b):
		s += chr(ord('a') + i)
	ans = s * (n // b) + s[:n % b]
	print(ans)


t = int(input())
alphabet = 'abcdefghijklmnopqrstuvwxyz'
for _ in range(t):
	(n, a, b) = list(map(int, input().split()))
	data = alphabet[:b]
	result = ''
	currlen = len(result)
	while currlen < n:
		if n - currlen >= b:
			result += data
		else:
			result += data[:n - currlen]
		currlen = len(result)
	print(result)


t = int(input())
for i in range(t):
	(n, a, b) = map(int, input().split(' '))
	sr = 'abcdefghijklmnopqrstuvwxyz'
	sr1 = sr[0:b]
	sr2 = sr[0:n % b]
	print(sr1 * (n // b) + sr2)


t = [int(i) for i in input().split(' ')][0]
for _ in range(t):
	(n, a, b) = [int(i) for i in input().split(' ')]
	word = ''
	pocet = n // a
	ok = True
	while ok:
		iterator = 0
		for letter in range(a):
			word += chr(97 + iterator)
			if len(word) >= n:
				ok = False
				break
			iterator += 1
			if iterator >= b:
				iterator = 0
	print(word)


for i in range(int(input())):
	(n, a, b) = (int(j) for j in input().split())
	j = 0
	k = 0
	ans = ''
	while j < n:
		ans += chr(97 + k)
		k = 0 if k == b - 1 else k + 1
		j += 1
	print(ans)


t = int(input())

def solve(nums):
	(n, a, b) = nums
	res = []
	sample = []
	i = 0
	cur = 0
	while i != b:
		sample.append(cur)
		cur += 1
		i += 1
	while i != a:
		sample.append(cur - 1)
		i += 1
	res = sample * (n // len(sample)) + sample[:n % len(sample)]
	for i in range(len(res)):
		res[i] = chr(97 + res[i])
	return ''.join(list(map(str, res)))
for _ in range(t):
	nums = list(map(int, input().split()))
	print(solve(nums))


t = int(input())
for x in range(t):
	(n, a, b) = map(int, input().split())
	apb = 'abcdefghijklmnopqrstuvwxyz'
	strfr = apb[:b] + apb[b - 1] * (a - b)
	print((strfr * (n // a + 1))[:n])


import string
t = int(input())
for i in range(t):
	(n, a, b) = map(int, input().split(' '))
	stringi = ''
	alphabet_string = string.ascii_lowercase
	alphabet_list = list(alphabet_string)
	for j in range(n // b):
		for k in range(b):
			stringi = stringi + alphabet_list[k]
	if len(stringi) < n:
		for k in range(n - len(stringi)):
			stringi = stringi + alphabet_list[k]
	print(stringi)


t = int(input())
for _ in range(t):
	(n, a, b) = map(int, input().split())
	chars = 'qwertyuioplkjhgfdsazxcvbnm'
	print((chars[:b] * (2 + n // b))[:n])


for i in range(int(input())):
	(n, a, b) = [int(s) for s in input().split()]
	s = 'abcdefghijklmnopqrstuvwxyz'
	res = s[:b] * (n // b) + s[:n % b]
	print(res)


def help():
	(a, b, d) = map(int, input().split(' '))
	temp = 'abcdefghijklmnopqrstuvwxyz'
	temp = temp[:d]
	while a > 0:
		if a > d:
			print(temp, end='')
		else:
			print(temp[:a], end='')
		a -= d
	print()
for qw in range(int(input())):
	help()


t = int(input())
for i in range(0, t):
	(n, a, b) = map(int, input().split())
	s = ''
	ans = {0: 'a', 1: 'b', 2: 'c', 3: 'd', 4: 'e', 5: 'f', 6: 'g', 7: 'h', 8: 'i', 9: 'j', 10: 'k', 11: 'l', 12: 'm', 13: 'n', 14: 'o', 15: 'p', 16: 'q', 17: 'r', 18: 's', 19: 't', 20: 'u', 21: 'v', 22: 'w', 23: 'x', 24: 'y', 25: 'z'}
	z = 0
	for i in range(0, n):
		if i % b == 0:
			z = 0
		s += ans[z]
		z += 1
	print(s)


t = int(input())
abd = 'abcdefghijklmnopqrstuvwxyz'

def solve():
	entry = list(map(int, input().split(' ')))
	n = int(entry[0])
	a = int(entry[1])
	b = int(entry[2])
	j = 0
	for i in range(0, n):
		print(abd[j], end='')
		j = (j + 1) % b
	print()
while t:
	solve()
	t -= 1


t = int(input())
for t1 in range(0, t):
	(n, a, b) = map(int, input().split())
	start = 97
	k = a - b
	s = ''
	if k == 0:
		for i in range(0, n):
			s = s + chr(start)
			start = start + 1
			if start > 122:
				start = 97
	elif b == 1:
		i = 0
		while i < n:
			s = s + 'a'
			i = i + 1
	else:
		i = 0
		while i < b:
			s = s + chr(start)
			start += 1
			i = i + 1
		while len(s) < n:
			s = s + s
		s = s[:n]
	print(s)


s = 'abcdefghijklmnopqrstuvwxyz'
t = int(input())
for i in range(t):
	l = [int(i) for i in input().split()]
	n = l[0]
	a = l[1]
	b = l[2]
	l = []
	for i in range(b):
		l.append(s[i])
	for i in range(b, n):
		l.append(l[i - b])
	print(''.join(l))


letters = 'abcdefghijklmnopqrstuvwxyz'
for t in range(int(input())):
	(n, a, b) = map(int, input().split())
	print(f'{letters[0:b] * (n // b)}{letters[0:n % b]}')


for t in range(int(input())):
	(n, a, b) = map(int, input().split())
	f = 'abcdefghijklmnopqrstuvwxyz'
	g = f[:b]
	l = ''.join(g)
	y = n // b
	u = n % b
	h = l * y + l[:u]
	print(h)


for _ in range(int(input())):
	(n, a, b) = map(int, input().split())
	s = 'abcdefghijklmnopqrstuvwxyz'
	temp = s[:b]
	q = a // b
	r = a % b
	temp *= q
	temp += s[:r]
	q = n // a
	r = n % a
	temp *= q
	temp += temp[:r]
	print(temp)


import math

def construct_the_string(n, a, b):
	abc = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
	result = ''
	index = 0
	for i in range(0, n):
		result += abc[index]
		index = (index + 1) % b
	print(result)
t = int(input())
for i in range(0, t):
	(n, a, b) = map(int, input().split())
	construct_the_string(n, a, b)


def main():
	import string
	alph = string.ascii_lowercase
	t = int(input())
	for i in range(t):
		s = ''
		(n, a, b) = list(map(int, input().split(' ')))
		for i in range(n):
			s += alph[i % b]
		print(s)
main()


t = int(input())
for i in range(t):
	(n, A, B) = map(int, input().split())
	res = ''
	for j in range(B):
		res = res + chr(97 + j)
	l = 0
	for j in range(B, n):
		res = res + res[l]
		l += 1
	print(res)


from collections import defaultdict as df
from sys import stdin, stdout
s = []
for i in range(97, 97 + 26):
	s.append(chr(i))
t = int(input())
for ii in range(t):
	(n, a, b) = list(map(int, input().split()))
	p = df(int)
	final = []
	for i in range(b):
		final.append(s[i])
		p[s[i]] += 1
	for i in range(a - b):
		final.append(final[i])
	for i in range(n - a):
		final.append(final[a - b + i])
	print(''.join(final))


t = int(input())
for i in range(0, t):
	(n, a, b) = [int(x) for x in input().split()]
	str1 = ''
	for j in range(0, a - b + 1, 1):
		str1 = str1 + chr(97)
	p = 98
	for j in range(a - b + 1, a, 1):
		str1 = str1 + chr(p)
		p = p + 1
	str2 = ''
	j = 0
	for k in range(0, n, 1):
		str2 = str2 + str1[j]
		j = j + 1
		if j == a:
			j = 0
	print(str2)


from __future__ import division, print_function
from fractions import Fraction
import sys
import os
from io import BytesIO, IOBase
from itertools import *
import bisect
from heapq import *
from math import *
from copy import *
from collections import deque
from collections import Counter as counter
from itertools import combinations as comb
from itertools import permutations as permutate
from bisect import bisect_left as bl
from bisect import bisect_right as br
from bisect import bisect
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')

def print(*args, **kwargs):
	(sep, file) = (kwargs.pop('sep', ' '), kwargs.pop('file', sys.stdout))
	at_start = True
	for x in args:
		if not at_start:
			file.write(sep)
		file.write(str(x))
		at_start = False
	file.write(kwargs.pop('end', '\n'))
	if kwargs.pop('flush', False):
		file.flush()
if sys.version_info[0] < 3:
	(sys.stdin, sys.stdout) = (FastIO(sys.stdin), FastIO(sys.stdout))
else:
	(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
from types import GeneratorType

def iterative(f, stack=[]):

	def wrapped_func(*args, **kwargs):
		if stack:
			return f(*args, **kwargs)
		to = f(*args, **kwargs)
		while True:
			if type(to) is GeneratorType:
				stack.append(to)
				to = next(to)
				continue
			stack.pop()
			if not stack:
				break
			to = stack[-1].send(to)
		return to
	return wrapped_func
mod = 1000000007

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

def out(var):
	sys.stdout.write(str(var))

def lis():
	return list(map(int, inp().split()))

def stringlis():
	return list(map(str, inp().split()))

def sep():
	return map(int, inp().split())

def strsep():
	return map(str, inp().split())

def zerolist(n):
	return [0] * n

def nextline():
	out('\n')

def testcase(t):
	for p in range(t):
		solve()

def printlist(a):
	for p in range(0, len(a)):
		out(str(a[p]) + ' ')

def solve():
	(n, a, b) = sep()
	temp = ''
	for i in range(b):
		temp += chr(i + 97)
	k1 = n // b
	s = temp * k1
	k2 = n % b
	s += temp[:k2]
	print(s)
testcase(int(inp()))


s = 'abcdefghijklmnopqrstuvwxyz'
T = int(input())
for _ in range(T):
	(n, a, b) = input().split()
	n = int(n)
	a = int(a)
	b = int(b)
	final_str = ''
	final_str = s[0:b]
	for i in range(b, n):
		final_str += final_str[i % b]
	print(final_str)


t = int(input())
import string
for i in range(t):
	(n, a, b) = input().split()
	(n, a, b) = (int(n), int(a), int(b))
	s = ''
	base = string.ascii_lowercase[:b]
	part = n % b
	i = 0
	times = n // b
	sub = ''
	while len(sub) != b:
		sub = sub + base[i]
		i = i + 1
	s = s + times * sub
	if part != 0:
		s = s + base[:part]
	print(s)


for _ in range(int(input())):
	(n, a, b) = map(int, input().split())
	s = 'a' * (a - b + 1) + ''.join((chr(t) for t in range(ord('b'), ord('b') + b - 1)))
	ans = ''.join((s for _ in range(a * (n // a + 1))))[:n]
	print(ans)


import string
n = int(input())
for i in range(n):
	(n, a, b) = [int(i) for i in input().split()]
	x = ''
	y = ''
	letters = string.ascii_letters
	for i in range(b):
		x += letters[i]
	for i in range(a - b):
		x += letters[b - 1]
	y = x * (n // a + 1)
	print(y[0:n])


t = int(input())
for _ in range(t):
	(n, a, b) = [int(x) for x in input().split()]
	for i in range(n):
		base = ord('a')
		print(chr(i % b + base), end='')
	print()


t = int(input())
for i in range(t):
	(n, a, b) = map(int, input().split())
	s = ''
	for i in range(b):
		s += chr(ord('a') + i)
	ans = ''
	for i in range(n // b + 1):
		ans += s
	while len(ans) != n:
		ans = ans[:-1]
	print(ans)


numcases = int(input())
for j in range(numcases):
	(n, a, b) = input().split(' ')
	str1 = ''
	for i in range(int(n)):
		char = chr(97 + i % int(b))
		str1 = str1 + char
	print(str1)


def solve(n, a, b):
	result = ''
	distinct_letters = 'abcdefghijklmnopqrstuvwxyz'[:b]
	for i in range(n):
		result += distinct_letters[i % b]
	return result
for i in range(int(input())):
	(n, a, b) = [int(x) for x in input().split()]
	print(solve(n, a, b))


for _ in range(int(input())):
	(n, a, b) = map(int, input().split())
	dic = list(map(chr, range(ord('a'), ord('z') + 1)))
	answer = []
	for i in range(n):
		answer.append(dic[i % b])
	print(''.join(answer))


for i in range(int(input())):
	(str_len, interval, uniq_count) = map(int, input().split())
	tmp_str = [chr(97 + i) for i in range(uniq_count)]
	final_str = (tmp_str * str_len)[0:str_len]
	print(''.join(final_str))


import sys, os
from io import BytesIO, IOBase
import collections, itertools, bisect, heapq, math, string
BUFSIZE = 8192
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))
input = lambda : sys.stdin.readline().rstrip('\r\n')

def main():
	t = int(input())
	for i in range(t):
		nab = list(map(int, input().split()))
		(n, a, b) = (nab[0], nab[1], nab[2])
		letter = string.ascii_lowercase[0:b]
		ans = letter * (n // b) + letter[0:n % b]
		print(ans)
main()


def sol():
	(n, a, b) = map(int, input().split())
	ans = ''
	count = 97
	for i in range(a):
		if i < a - b + 1:
			ans += 'a'
		else:
			ans += chr(count + 1)
			count += 1
	a1 = len(ans)
	if n - a1 == 0:
		return ans
	elif n % a1 == 0:
		ans += ans * (n // a1 - 1)
	else:
		ans += ans * (n // a1 - 1) + ans[:n - a1 * (n // a1)]
	return ans
for _ in range(int(input())):
	print(sol())


t = int(input())
while t > 0:
	t = t - 1
	l = [int(i) for i in input().split()]
	(a, b, c) = (l[0], l[1], l[2])
	q = c
	k = ''
	ch = 'a'
	while c > 0:
		k = k + ch
		ch = chr(ord(ch) + 1)
		c = c - 1
	n = a // q
	o = a % q
	m = [k] * n
	for i in range(0, o):
		m.append(k[i])
	e = ''.join(m)
	print(e)


from collections import defaultdict, deque
from itertools import permutations, product, combinations
from functools import lru_cache
from time import time
import sys
from operator import itemgetter
start = time()

def show_time():
	print(time() - start, file=sys.stderr)
try:
	f = open('test.in')

	def ints():
		return map(int, f.readline().strip().split())

	def one_int():
		return int(f.readline())

	def one_string():
		return f.readline().strip()

	def strings():
		return f.readline().strip().split()
except FileNotFoundError:

	def ints():
		return map(int, input().strip().split())

	def one_int():
		return int(input())

	def one_string():
		return input().strip()

	def strings():
		return input().strip().split()

def debug(s):
	print(s, file=sys.stderr)
sys.stderr.write('\n')
t = one_int()
alphabet = 'abcdefghijklmnopqrstuvwxyz'
for _ in range(t):
	(n, a, b) = ints()
	r = alphabet[:b]
	for i in range(b + 1, a + 1):
		r += r[(i - 1) % b]
	for i in range(a + 1, n + 1):
		r += r[-a]
	print(r)


import math
t = int(input())
base = 'abcdefghijklmnopqrstuvwxyz'
for case in range(t):
	(n, a, b) = map(int, input().split())
	res = ''
	fact = math.ceil(n / a)
	while len(res) < n:
		res += base[:b] * fact
	print(res[:n])


abcd = ''.join((chr(c) for c in range(ord('a'), ord('z') + 1)))
t = int(input())
for _ in range(t):
	(n, a, b) = map(int, input().split())
	s = abcd[:b] + abcd[b - 1] * (a - b)
	print(s * (n // a) + s[:n % a])


import math
t = int(input())
alp = 'abcdefghijklmnopqrstuvwxyz'
for i in range(t):
	(n, a, b) = map(int, input().split())
	if b > 1:
		x = alp[:b]
		y = math.ceil(n / b)
		z = x * y
		z = z[:n]
		print(z)
	else:
		z = 'a' * n
		print(z)


for _ in range(int(input())):
	(n, a, b) = map(int, input().split())
	s = 'abcdefghijklmnopqrstuvwxyz'
	string = s[:b]
	final_string = string * (n // b) + string[:n % b]
	print(final_string)


from __future__ import division, print_function
import os
import sys
from io import BytesIO, IOBase
from math import sqrt, floor, factorial, gcd, log, ceil
from collections import deque, Counter, defaultdict
from itertools import permutations, combinations
from math import gcd
from bisect import bisect
if sys.version_info[0] < 3:
	from __builtin__ import xrange as range
	from future_builtins import ascii, filter, hex, map, oct, zip
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')

def print(*args, **kwargs):
	(sep, file) = (kwargs.pop('sep', ' '), kwargs.pop('file', sys.stdout))
	at_start = True
	for x in args:
		if not at_start:
			file.write(sep)
		file.write(str(x))
		at_start = False
	file.write(kwargs.pop('end', '\n'))
	if kwargs.pop('flush', False):
		file.flush()
if sys.version_info[0] < 3:
	(sys.stdin, sys.stdout) = (FastIO(sys.stdin), FastIO(sys.stdout))
else:
	(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
read = lambda : list(map(int, input().strip().split(' ')))

def solution():
	for i in range(int(input())):
		(n, a, b) = map(int, input().split())
		ans = ''
		for i in range(n):
			alpha = chr(97 + i % b)
			ans += alpha
		print(ans)
solution()


from collections import deque
t = int(input())
for _ in range(t):
	(n, a, b) = map(int, input().split())
	ans = ''
	kind = 0
	d = deque()
	for c in 'abcdefghijklmnopqrstuvwxyz':
		d.append(c)
	ans_d = deque()
	while len(ans) < n:
		if len(ans) == 0:
			for i in range(a):
				if kind < b:
					ans += d.popleft()
					kind += 1
				else:
					ans += ans[-1]
				ans_d.append(ans[-1])
		else:
			ans += ans_d.popleft()
			ans_d.append(ans[-1])
	print(ans)


t = int(input())
alpha = 'a'
l = []
for i in range(0, 26):
	l += [alpha]
	alpha = chr(ord(alpha) + 1)
for i in range(0, t):
	ans = ''
	(n, a, b) = [int(i) for i in input().split()]
	reps = int(n // a) + 1
	for f in range(0, reps):
		for g in range(0, b - 1):
			ans += l[g]
		ans += l[b - 1] * (a - b + 1)
	print(ans[:n])


t = int(input())
alpha = list('abcdefghijklmnopqrstuvwxyz')
for _ in range(t):
	(n, a, b) = map(int, input().split())
	arr_b = ''.join(alpha[:b])
	arr = arr_b * (n // b)
	arr += arr_b[:n % b]
	print(arr)


t = int(input())
for i in range(0, t):
	(n, a, b) = input().split(' ')
	n = int(n)
	a = int(a)
	b = int(b)
	s = ''
	cnt = 0
	for i in range(0, n):
		s += chr(ord('a') + cnt % b)
		cnt += 1
	print(s)


t = int(input())
while t != 0:
	t -= 1
	(n, a, b) = [int(x) for x in input().split()]
	unique = [chr(x) for x in range(ord('a'), ord('a') + b)]
	s = unique
	i = 0
	while len(s) != n:
		i += 1
		letter = list(set(unique) - set(s[i:]))
		s.append(letter[0])
	print(''.join(s))


for _ in range(int(input())):
	(n, a, b) = map(int, input().split())
	alf = list('a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z'.split(','))
	s = 'a'
	for i in range(b - 1):
		s += alf[i + 1]
	if b != a:
		rem1 = a - b
		p = s[-1]
		p = p * rem1
		s += p
	rem = n % a
	tot = n // a
	if tot > 1:
		s = s * tot
	s += s[:rem]
	print(s)


t = int(input())
latin = 'abcdefghijklmnopqrstuvwxyz'
for i in range(t):
	(n, a, b) = map(int, input().split())
	string = latin[:b] * n
	print(string[:n])


from pprint import pprint
import sys
input = sys.stdin.readline
q = int(input())
for _ in range(q):
	(n, a, b) = map(int, input().split())
	s = ''
	cnt = 0
	for i in range(n):
		s += chr(ord('a') + i % b)
	print(s)


t = int(input())
for _ in range(t):
	(n, a, b) = list(map(int, input().split()))
	ch = 'a'
	rep = ''
	for i in range(b):
		rep = rep + ch
		ch = chr(ord(ch) + 1)
	ans = rep * 10000
	print(ans[:n])


import string

def create_substr(l, n):
	str = l // n * string.ascii_lowercase[:n]
	str += str[:l % n]
	return str
for _ in range(int(input())):
	(n, a, b) = map(int, input().split())
	sstr = create_substr(a, b)
	s = n // a * sstr + sstr[:n % a]
	print(s)


def get_dis(n):
	s = ''
	if n > 25:
		n = 25
	for c in range(ord('b'), ord('b') + n):
		s += chr(c)
	return s
T = int(input())
while T > 0:
	(n, a, b) = map(int, input().split())
	s = ''
	s += 'a' * (a - b + 1)
	s += get_dis(b - 1)
	res = ''
	for i in range(n):
		res += s[i % len(s)]
	print(res)
	T -= 1


t = int(input())
while t:
	t -= 1
	(n, a, b) = map(int, input().split())
	res = 97
	l = []
	for i in range(b):
		l += [chr(res)]
		res += 1
	res = res - 1
	while i < a:
		l += [chr(res)]
		i += 1
	j = 0
	ans = []
	for i in range(n):
		ans += [l[j]]
		j += 1
		if j == a:
			j = 0
	print(''.join(ans))


t = int(input())
for tt in range(t):
	(n, a, b) = [int(x) for x in input().split(' ')]
	ans = [0] * n
	block = [0] * a
	ct = 97
	for i in range(a):
		block[i] = chr(ct)
		if ct - 96 < b:
			ct += 1
	for i in range(n):
		ans[i] = block[i % a]
	for i in range(n - 1):
		print(ans[i], end='')
	print(ans[-1], end='\n')


def main():
	latin = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
	t = int(input())
	for i in range(t):
		inputNum = input().split(' ')
		n = int(inputNum[0])
		a = int(inputNum[1])
		b = int(inputNum[2])
		s = [''] * n
		distinctLetters = latin[0:b]
		if a == b:
			if n > len(latin):
				quo = int(n / len(latin))
				for i in range(0, (quo + 1) * 26, 26):
					s[i:i + 26] = latin
				mod = n % len(latin)
				s[i:] = latin[0:mod]
			else:
				s = latin[0:n]
		else:
			for i in range(n):
				s[i] = distinctLetters[(a - i) % b]
		print(''.join(s))
main()


t = int(input())
for i in range(t):
	letter = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
	(n, a, b) = input().split()
	(n, a, b) = (int(n), int(a), int(b))
	newletter = letter[:b]
	newletter = newletter + [letter[b - 1]] * (a - b)
	back = newletter[0]
	for j in range(1, n - a + 1):
		newletter = newletter + [back]
		back = newletter[j]
	print(''.join(newletter))


for _ in range(int(input())):
	xnk = list(map(int, input().rstrip().rsplit()))
	(x, n, k) = (xnk[0], xnk[1], xnk[2])
	s = ''
	(a, b) = (x % k, x // k)
	s = ''.join([chr(i + 97) for i in range(k)]) * b
	s = s + s[0:a]
	print(s)


def create_sub_string(length, sub_length, symbols):
	s = 'A B C D E F G H I J K L M N O P Q R S T U V W X Y Z'
	s = s.lower()
	s = s.split()
	string = s[:symbols]
	string += s[symbols - 1] * (sub_length - symbols)
	for i in range(length - sub_length):
		if len(set(string[i + 1:i + sub_length])) == symbols:
			string += string[-1]
		else:
			string += string[i]
	print(''.join(string))

def read():
	s = input()
	(length, sub_length, symbold) = [int(s) for s in s.split()]
	return (length, sub_length, symbold)
tests = int(input())
argss = [read() for _ in range(tests)]
for args in argss:
	create_sub_string(args[0], args[1], args[2])


t = int(input())
for i in range(t):
	numbers = [int(n) for n in input().split()]
	n = numbers[0]
	a = numbers[1]
	b = numbers[2]
	max = a - b + 1
	ans = ''
	while len(ans) <= n:
		ans += chr(97) * max
		for j in range(b - 1):
			ans += chr(98 + j)
	print(ans[0:n])


for t in range(int(input())):
	(n, a, b) = map(int, input().split())
	s = ''
	x = 'a'
	for i in range(b):
		s += chr(ord(x) + i)
	res = ''
	for i in range(n):
		res += s[i % len(s)]
	print(res)


def solve():
	(N, A, B) = [int(i) for i in input().split()]
	chars = list('abcdefghijklmnopqrstuvwxyz')
	ind = 0
	res = []
	for _ in range(N):
		res.append(chars[ind])
		ind = (ind + 1) % B
	print(''.join(res))
T = int(input())
for t in range(T):
	solve()


T = int(input())
for tc in range(T):
	(n, a, b) = map(int, input().split())
	asc = 97
	sn = ''
	sa = ''
	sb = ''
	for i in range(0, b):
		sb += chr(asc)
		asc += 1
	mf1 = a // b
	rf1 = a % b
	sa = sb * mf1 + sb[:rf1]
	mf2 = n // a
	rf2 = n % a
	sn = sa * mf2 + sa[:rf2]
	print(sn)


for _ in range(int(input())):
	numeros = list(map(int, input().split()))
	aux = 1
	cont = 1
	string = ''
	for i in range(numeros[0]):
		string = string + chr(96 + aux)
		if cont >= numeros[1]:
			aux = 0
			cont = 0
		if aux < numeros[2]:
			aux = aux + 1
		cont = cont + 1
	print(string)


for _ in range(int(input())):
	(n, a, b) = map(int, input().split())
	c = a // b
	s = ''
	d = 1
	e = 1
	k = 'a'
	for i in range(a):
		if d <= c:
			s += k
			d += 1
		if e >= b:
			s += k * (a - i - 1)
			break
		if d >= c:
			d = 1
			k = chr(ord(k) + 1)
			e += 1
	h = n - a
	if h > a:
		s += s * (h // a)
		s += s[:h % a]
	else:
		s += s[:h]
	print(s)


import os
import sys
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))
input = lambda : sys.stdin.readline().rstrip('\r\n')
from math import factorial
from collections import Counter, defaultdict
from heapq import heapify, heappop, heappush

def RL():
	return map(int, sys.stdin.readline().rstrip().split())

def N():
	return int(input())

def comb(n, m):
	return factorial(n) / (factorial(m) * factorial(n - m)) if n >= m else 0

def perm(n, m):
	return factorial(n) // factorial(n - m) if n >= m else 0

def mdis(x1, y1, x2, y2):
	return abs(x1 - x2) + abs(y1 - y2)
mod = 1000000007
INF = float('inf')

def main():
	for _ in range(N()):
		(n, a, b) = RL()
		A = ord('a')
		now = [chr(i + A) for i in range(b)]
		while len(now) < n:
			now += now
		print(''.join(now[:n]))
main()


import math
t = int(input())
for i in range(t):
	(n, a, b) = map(int, input().split())
	s = ''
	for j in range(b):
		s += chr(97 + j)
	s1 = s
	while len(s) < a:
		s += s1
	s = s[:a]
	s1 = s
	while len(s) < n:
		s += s1
	print(s[:n])


let = 'abcdefghijklmnopqrstuvwxyz'
for _ in range(int(input())):
	(n, a, b) = map(int, input().strip('\n').split())
	print((('a' * (a - b + 1) + let[1:b]) * n)[:n])


for _ in range(int(input())):
	(n, a, b) = map(int, input().split())
	arr = 'abcdefghijklmnopqrstuvwxyz'
	use = arr[:b]
	ans = ''
	for i in range(n):
		ans += use[i % b]
	print(ans)


tc = int(input())
for _ in range(tc):
	(n, a, b) = map(int, input().split())
	letters = ''.join([chr(ord('a') + i) for i in range(b)])
	ans = letters * ((n + b) // b)
	ans = ans[:n]
	print(ans)


t = int(input())
alphabet = 'qwertyuiopasdfghjklzxcvbnm'
for _ in range(t):
	(n, a, b) = map(int, input().split(' '))
	repeated = alphabet[0:b] + alphabet[0] * (a - b)
	output = repeated * (n // a) + repeated[0:n % a]
	print(output)


alphabets = 'abcdefghijklmnopqrstuvwxyz'
for _ in range(int(input())):
	(n, a, b) = map(int, input().split())
	string = alphabets[:b]
	rem = alphabets[:n % b]
	ans = string * (n // b) + rem
	print(ans)


def create_string(n, a, b):
	s = ''
	x = ''
	i = 0
	while i < b:
		x += chr(i + 97)
		i += 1
	s += x
	j = b
	while j < n:
		s += x
		j += b
	s = s[:n]
	return s
t = int(input())
for i in range(t):
	(n, a, b) = input().split()
	n = int(n)
	a = int(a)
	b = int(b)
	print(create_string(n, a, b))


t = int(input())
pole = []
for x in range(t):
	pole.append([int(x) for x in input().split()])
for prvok in pole:
	(n, a, b) = prvok
	pocet = 0
	s = ''
	while pocet < n:
		aktualne_b = 0
		for x in range(b):
			if pocet < n:
				s += chr(97 + x)
				aktualne_b += 1
				pocet += 1
		for x in range(a - b):
			if pocet < n:
				s += chr(97 + b - 1)
				aktualne_b += 1
				pocet += 1
	print(s)


for _ in range(int(input())):
	(x, y, z) = map(int, input().split())
	count = 97
	arr = []
	str = ''
	if z == 1:
		arr = [chr(count)] * x
	else:
		for i in range(0, x):
			arr.append(chr(count + i % z))
	print(str.join(arr))
	arr.clear()


for t in range(int(input())):
	(n, a, b) = map(int, input().split())
	s = 'abcdefghijklmnopqrstuvwxyz'
	r = s[:b]
	d = n // b
	r = r * d
	c = n % b
	print(r + r[:c])


def solve(n, a, b):
	out = str()
	s_min = 97
	s = str()
	for x in range(b):
		s_int = x + s_min
		s += chr(s_int)
	out = s * (n // b)
	out += s
	return out[:n]
T = int(input())
for x in range(T):
	(n, a, b) = [int(x) for x in input().split()]
	y = solve(n, a, b)
	print(y)


from sys import stdin, stdout
for _ in range(int(stdin.readline().strip())):
	(n, a, b) = list(map(int, stdin.readline().strip().split()))
	alp = list(map(chr, range(97, 123)))
	print(''.join(alp[:b]) * (n // b) + ''.join(alp[:n % b]))


t = int(input())
for _ in range(t):
	(n, a, b) = map(int, input().split())
	st = ''
	for i in range(b):
		st += chr(i + 97)
	st = st * (n // b + 1)
	print(st[:n])


import string
import math
t = int(input())
for i in range(t):
	(n, a, b) = map(int, input().split())
	s = ''
	al = string.ascii_lowercase
	for j in range(b):
		s += al[j]
	s = s * (n // b)
	g = n - len(s)
	for j in range(g):
		s += s[j]
	print(s)


T = int(input())
letters = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
for t in range(T):
	(s1, s2) = ('', '')
	(n, a, b) = map(int, input().split())
	while len(s1) < a:
		for i in range(b):
			s1 += letters[i]
	while len(s2) < n:
		for i in s1:
			if len(s2) == n:
				break
			else:
				s2 += i
	print(s2)


for i in range(int(input())):
	a = list(map(int, input().strip().split()))[:3]
	r = ''
	y = 0
	for k in range(a[1]):
		if k < a[2]:
			r += chr(97 + k)
			y = k
		else:
			r += chr(97 + y)
	t = len(r)
	for l in range(t, a[0]):
		r = r + r[l % t]
	print(r)


t = int(input())
for _ in range(t):
	(n, a, b) = list(map(int, input().split()))
	d = b - a
	abc = 0
	ansi = []
	for i in range(n):
		ansi.append(i % b)
	ans = ''
	for x in ansi:
		ans += chr(x + ord('a'))
	print(ans)


let = 'abcdefghijklmnopqrstuvwxyz'
for _ in range(int(input())):
	(n, a, b) = map(int, input().split())
	substr = n - a
	initial = let[:b]
	initial = initial * (a // b + 1)
	initial = initial[:a]
	print(initial, end='')
	index = 0
	for i in range(substr):
		print(initial[index], end='')
		index += 1
		if index >= a:
			index = 0
	print()


for _ in range(int(input())):
	(n, a, b) = map(int, input().split())
	x = ord('a')
	substr = ''
	for i in range(0, a):
		substr += chr(x + i % b)
	for i in range(n // a):
		print(substr, end='')
	for i in range(0, n % a):
		print(substr[i], end='')
	print()


from sys import stdin, stdout
import traceback
import math
import bisect
from typing import List, Tuple
import itertools as it
read = lambda : stdin.readline().strip()
write = stdout.write
writeln = lambda x: write(str(x) + '\n')

def reads(typ=int):
	return list(map(typ, read().split()))

def enumerate_sorted(iterable):
	return sorted(zip(it.count(), iterable), key=lambda x: x[1])

class Sol:

	@classmethod
	def input(cls):
		return cls()

	def solve(self):
		(n, a, b) = reads()
		res = list(it.islice(it.cycle('abcdefghijklmnopqrstuvwxyz'[:b]), n))
		return ''.join(res)
try:
	t = int(read())
	for _ in range(t):
		res = Sol.input().solve()
		writeln(res)
except Exception as e:
	print('Got exception:', repr(e))
	print(traceback.format_exc())


s = 'abcdefghijklmnopqrstuvwxyz'
for _ in range(int(input())):
	(n, a, b) = map(int, input().split())
	ans = ''
	for i in range(n):
		ans += s[i % b]
	print(ans)


import sys
import string
input = sys.stdin.buffer.readline
lis = string.ascii_letters[:26]
t = int(input())
while t:
	t -= 1
	(n, m, k) = [int(x) for x in input().split()]
	sub = lis[:k]
	ans = sub * (n // k + 1)
	ans = ans[:n]
	print(ans)


s = 'abcdefghijklmnopqrstuvwxyz'
czy = 520
a1 = int(input())
for i in range(a1):
	(n, a, b) = map(int, input().split())
	tmp = s[0:b] * (a // b) + s[0:a % b]
	print(tmp * (n // a) + tmp[0:n % a])


import math
import random

def encryption(s):
	s = s.replace(' ', '')
	tamanho = len(s)
	raiz = math.sqrt(tamanho)
	rows = math.floor(raiz)
	columns = math.ceil(raiz)
	matrizPalavras = []
	counter = 0
	sFinal = ''
	if rows * columns < tamanho:
		rows += 1
	for i in range(rows):
		sBuffer = ''
		for j in range(columns):
			if counter < len(s):
				sBuffer += s[counter]
			counter += 1
			if counter >= len(s):
				sBuffer += ' '
		matrizPalavras.append(sBuffer)
	for i in range(columns):
		sBuffer = ''
		for j in range(rows):
			if matrizPalavras[j][i] != ' ':
				sBuffer += matrizPalavras[j][i]
		sFinal += sBuffer + ' '
	return sFinal

def nightAtMuseum():
	alfabeto = ['o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n']
	rotacoes = 0
	ponteiroF = 12
	ponteiroA = 12
	string = input()
	for c in string:
		charPF = ''
		charPA = ''
		while charPF != c and charPA != c:
			if ponteiroF == len(alfabeto):
				ponteiroF = 0
			if ponteiroA == -1:
				ponteiroA = 25
			charPF = alfabeto[ponteiroF]
			charPA = alfabeto[ponteiroA]
			if charPF != c and charPA != c:
				ponteiroF += 1
				ponteiroA -= 1
				rotacoes += 1
		ponteiroA = alfabeto.index(c)
		ponteiroF = alfabeto.index(c)
	print(rotacoes)

def constructString():
	t = int(input())
	for i in range(t):
		n = input()
		n = n.split(' ')
		tamanho = int(n[0])
		substring = int(n[1])
		diferentes = int(n[2])
		stringFinal = ''
		counterString = 0
		counter = 0
		counterDiferentes = 0
		while counter != substring:
			if counterDiferentes != diferentes:
				c = random.randint(97, 122)
				while chr(c) in stringFinal:
					c = random.randint(97, 122)
				stringFinal += chr(c)
				counterDiferentes += 1
			else:
				c = random.choice(stringFinal)
				stringFinal += c
			counter += 1
			counterString += 1
		for j in range(tamanho - substring):
			counterDiferentes = 0
			listaDiferentes = []
			for char in stringFinal[j + 1:len(stringFinal)]:
				if char not in listaDiferentes:
					listaDiferentes.append(char)
					counterDiferentes += 1
			if counterDiferentes < diferentes or substring == 1:
				c = random.randint(97, 122)
				while chr(c) in listaDiferentes:
					c = random.randint(97, 122)
				stringFinal += chr(c)
				listaDiferentes.append(c)
			else:
				c = random.choice(listaDiferentes)
				stringFinal += c
		print(stringFinal)
constructString()


alph = 'qwertyuiopasdfghjklzxcvbnm'

def main():
	(n, a, b) = map(int, input().split())
	while n > 0:
		print(alph[:min(b, n)], end='')
		n -= b
	print()
t = int(input())
for _ in range(t):
	main()


n = int(input())
for i in range(0, n):
	lis = []
	p = -1
	li = list(map(int, input().split()))
	for j in range(0, li[2]):
		lis.append(chr(97 + j))
	while li[0] > 0:
		p = p + 1
		print(lis[p], end='')
		if p == len(lis) - 1:
			p = -1
		li[0] = li[0] - 1
	print()


import os
import sys
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))
input = lambda : sys.stdin.readline().rstrip('\r\n')
testcases = int(input())
for j in range(testcases):
	vals = list(map(int, input().split()))
	n = vals[0]
	a = vals[1]
	b = vals[2]
	reps = a - b - 1
	nums = a - 1
	output = [chr(97) for k in range(reps)]
	for s in range(a - 1 - reps):
		output.append(chr(s + 97))
	out1 = []
	for b in range(n):
		out1.append(output[b % len(output)])
	print(''.join(out1))


for _ in range(int(input())):
	k = 'abcdefghijklmnopqrstuvwxyz'
	(a, b, c) = map(int, input().split())
	x = int(0)
	d = str()
	for t in range(a):
		d = d + k[x]
		x = x + 1
		if x == c:
			x = 0
	print(d)


for _ in range(int(input())):
	(n, a, b) = map(int, input().split())
	s = ''
	for i in range(b):
		s += chr(ord('a') + i)
	if b < a:
		s += (a - b) * chr(ord('a') + i)
	for i in range(n - a):
		s += s[i]
	print(s)


count = int(input())
n = a = b = 0
pst = st = ''
for i in range(count):
	(n, a, b) = map(int, input().split())
	for j in range(b):
		pst += chr(97 + j)
	b = a - b
	j = 0
	while j < b:
		pst += 'a'
		j += 1
	for j in range(n):
		st += pst[j % a]
	print(st)
	pst = st = ''


import math
for _ in range(int(input())):
	(n, a, b) = map(int, input().split())
	s = ''
	char = 97
	for _ in range(b):
		s = s + chr(char)
		char += 1
	st = ''
	for _ in range(math.floor(n / len(s)) + 1):
		st = st + s
	if len(st) > n:
		st = st[:-(len(st) - n)]
	print(st)


t = int(input())
for i in range(t):
	(n, a, b) = map(int, input().split(' '))
	bstr = ''.join((chr(i + ord('a')) for i in range(b)))
	to_ret = ''
	for i in range(n // b):
		to_ret += bstr
	to_ret += bstr[:n % b]
	print(to_ret)


from string import ascii_lowercase
t = int(input())
for case in range(t):
	(n, a, b) = map(int, input().split())
	out = 'a' * (a - b) + ascii_lowercase[:b]
	out = out * (n // len(out) + 1)
	print(out[:n])


for _ in range(int(input())):
	(n, a, b) = map(int, input().split())
	x = ''
	for i in range(b):
		x += chr(i + 97)
	ans = x * (n // b)
	rem = n % b
	print(ans + x[:rem])


import string
T = int(input())
for t in range(0, T):
	alpha = string.ascii_lowercase
	(n, a, b) = (int(x) for x in input().split())
	answer = ''
	sub = ''
	counter = 0
	for i in range(0, a):
		sub += alpha[counter]
		if counter < b - 1:
			counter += 1
	answer = sub * (n // a) + sub[0:n % a]
	print('{}\n'.format(answer))


s = 'qwertyuiopasdfghjklzxcvbnm'
for _ in range(int(input())):
	(n, a, b) = map(int, input().split())
	t = s[:b]
	x = (n + b - 1) // b
	t = t * x
	print(t[:n])


t = int(input())
lst = [chr(i) for i in range(97, 123)]
for i in range(t):
	(n, a, b) = [int(x) for x in input().split()]
	(s, t) = ('', '')
	for i in range(b):
		s += lst[i]
	for i in range(n % b):
		t += lst[i]
	print(s * (n // b) + t)


import string
t = int(input())
for i in range(t):
	s = ''
	res = ''
	(n, a, b) = map(int, input().split())
	for i in string.ascii_lowercase:
		s += i
		if len(s) == b:
			break
	res = s * (n // b)
	res += res[:n % b]
	print(res)


import sys
input = sys.stdin.readline
t = int(input())
for _ in range(t):
	(n, a, b) = [int(i) for i in input().split()]
	prev = 'a'
	ans = ''
	for i in range(a):
		if i < b:
			ans += chr(97 + i)
		else:
			ans += 'a'
	for i in range(a, n):
		ans += ans[i - a]
	print(ans)


for x in range(int(input())):
	(n, a, b) = map(int, input().split())
	s = str()
	c = int(97)
	for _ in range(b):
		s = s + chr(c)
		c = c + 1
	for _ in range(a - b):
		s = s + s[_]
	for _ in range(n - a):
		s = s + s[_]
	print(s)


T = int(input())
for _ in range(T):
	(n, a, b) = map(int, input().split())
	s = ['a'] * n
	alpha = 'abcdefghijklmnopqrstuvwxyz'
	for i in range(n):
		if i % a < b:
			s[i] = alpha[i % a]
		else:
			s[i] = alpha[b - 1]
	print(*s, sep='')


for _ in range(int(input())):
	(n, a, b) = map(int, input().split())
	tc = ''
	for i in range(n):
		tc += chr(i % b + 97)
	print(tc)


import os
import sys
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))
input = lambda : sys.stdin.readline().rstrip('\r\n')
t = int(input())
for _ in range(t):
	(n, a, b) = (int(i) for i in input().split())
	ans = []
	m = {}
	ctr = 0
	ori = [chr(97 + i) for i in range(b)]
	for i in range(a - b):
		ori.append(ori[-1])
	for _ in range(n):
		ans.append(ori[_ % len(ori)])
	print(''.join(ans))


t = int(input())
r = 'abcdefghijklmnopqrstuvwxyz'
for case_num in range(t):
	(n, a, b) = map(int, input().split(' '))
	if b == 1:
		print(''.join(['a' for i in range(n)]))
	else:
		s = r[:b - 1]
		for i in range(a - b + 1):
			s += r[b - 1]
		ans = ''
		while len(ans) < n:
			ans += s
		print(ans[:n])


def read_tokens():
	return input().strip().split(' ')

def read_ints():
	return [int(s) for s in read_tokens()]

def f(n, a, b):
	substr = ''
	for i in range(b):
		substr += chr(97 + i)
	substr = substr * a
	while len(substr) < n:
		substr += substr
	return substr[:n]
(T,) = read_ints()
for test in range(T):
	(n, a, b) = read_ints()
	string = f(n, a, b)
	print(string)


alphabets = 'abcdefghijklmnopqrstuvwxyz'
tc = int(input())
for _ in range(tc):
	(n, a, b) = list(map(int, input().split()))
	ans = ''
	now = alphabets[:b]
	full = n // b
	for q in range(full):
		ans += now
	rem = n - len(ans)
	if rem == 0:
		print(ans)
	else:
		ans += now[:rem]
		print(ans)


from string import ascii_lowercase

def solve(n, a, b):
	result = [ascii_lowercase[:b]] * n
	return ''.join(result)[:n]

def main():
	t = int(input())
	for _ in range(t):
		(n, a, b) = [int(x) for x in input().split()]
		print(solve(n, a, b))
main()


def f(n, a, b):
	A = ['a', 'z', 'e', 'r', 't', 'y', 'u', 'i', 'o', 'p', 'q', 's', 'd', 'f', 'g', 'h', 'j', 'k', 'l', 'm', 'w', 'x', 'c', 'v', 'b', 'n']
	S = ''
	if a != b or b == 1:
		for j in range(a - b):
			S += 'a'
	if a == b:
		for j in range(a):
			S += A[j]
	else:
		for i in range(b - 1):
			S += A[i + 1]
	T = S
	i = 0
	while len(S) < n:
		S += T[i]
		if i == len(T) - 1:
			i = 0
		else:
			i += 1
	return S
t = int(input())
while t > 0:
	(n, a, b) = map(int, input().split())
	print(f(n, a, b))
	t -= 1


for i in range(int(input())):
	(n, a, b) = map(int, input().split())
	s = 'abcdefghijklmnopqrstuvwxyz'
	st = ''
	for i in range(n):
		st += s[0:b]
	print(st[0:n])


N = int(input())
letters = 'abcdefghijklmnopqrstuvwxyz'
for string in range(N):
	[N, A, B] = list(map(int, input().split()))
	ans = ''
	i = 0
	while len(ans) != N:
		ans += letters[i]
		i = (i + 1) % B
	print(ans)


import math
for _ in range(int(input())):
	(n, a, b) = map(int, input().split())
	s = 'abcdefghijklmnopqrstuvwxyz'
	k = n // a
	r = n % a
	t = (s[:b] + (a - b) * s[b - 1]) * k
	t += t[:r]
	print(t)


def string(n, a, b):
	s = ''
	for i in range(n):
		s += chr(97 + i % b)
	return s
t = int(input())
for i in range(t):
	(n, a, b) = input().split()
	n = int(n)
	a = int(a)
	b = int(b)
	print(string(n, a, b))


def func(a):
	s = ''
	for i in a:
		s += str(i)
	return s
t = int(input())
while t > 0:
	t = t - 1
	(n, a, b) = map(int, input().split())
	undex = 0
	inp = [0 for i in range(n)]
	for i in range(n):
		temp = chr(undex + 97)
		inp[i] = temp
		undex = (undex + 1) % b
	print(func(inp))


t = int(input())
alpha = 'abcdefghijklmnopqrstuvwxyz'
for i in range(t):
	(n, a, b) = [int(s) for s in input().split()]
	snip = alpha[0:b]
	print(snip * (n // len(snip)) + snip[0:n % len(snip)])


for i in range(int(input())):
	q = 'abcdefghijklmnopqrstuvwxyz'
	(n, a, b) = map(int, input().split())
	c = n // b
	d = n % b
	print(c * q[0:b] + q[0:d])


import string
t = int(input())
for _ in range(t):
	(n, a, b) = tuple(map(int, input().split()))
	s = string.ascii_lowercase[:b] + 'a' * (a - b)
	while len(s) < n:
		s += s
	print(s[:n])


import sys
import math

def read_line():
	return sys.stdin.readline()[:-1]

def read_int():
	return int(sys.stdin.readline())

def read_int_line():
	return [int(v) for v in sys.stdin.readline().split()]
t = read_int()
for i in range(t):
	(n, a, b) = read_int_line()
	s = ''
	for i in range(b):
		s += chr(ord('a') + i)
	ans = s * (n // b) + s[:n % b]
	print(ans)


from string import ascii_lowercase

def solve():
	(n, a, b) = map(int, input().split())
	ans = None
	base = ''
	i = 0
	while len(base) < a:
		if i < b:
			base += ascii_lowercase[i]
			i += 1
		else:
			base += 'a'
	for i in range(a, n):
		base += base[i % a]
	print(base)
t = int(input())
while t > 0:
	solve()
	t -= 1


n = int(input())
s = 'abcdefghijklmnopqrstuvwxyz'
for i in range(n):
	(a, b, c) = [int(x) for x in input().split()]
	s1 = s[:c]
	s1 = s1 + (b - c) * s1[-1]
	print(int(a / b) * s1 + s1[:a % b])


s = 'abcdefghijklmnopqrstuvwxyz'
for _ in range(int(input())):
	(a, b, c) = map(int, input().split())
	k = s[0:c] * (a // c) + s[0:a % c]
	print(k)


t = int(input())
while t > 0:
	ac = ord('a')
	(n, a, b) = map(int, input().split())
	template = (a - b) * chr(ac)
	for i in range(ac, ac + b):
		template += chr(i)
	answer = ''
	answer += template * (n // a)
	answer += template[:n % a]
	print(answer)
	t -= 1


test = int(input())
while test > 0:
	s1 = 'abcdefghijklmnopqrstuvwxyz'
	s2 = ''
	num = input().split()
	(n, a, b) = num
	n = int(n)
	a = int(a)
	b = int(b)
	for i in range(b):
		s2 += s1[i]
	n = n - b
	start = 0
	end = b - 1
	for i in range(n):
		if start > end:
			start = 0
		add = s2[start]
		s2 += add
		start = start + 1
	print(s2)
	test = test - 1


xt = 'abcdefghijklmnopqrstuvwxyz'
for _ in range(int(input())):
	tk = ''
	(n, a, b) = map(int, input().split())
	x = xt[:b]
	if n > b:
		t = n // b
		tro = t
		tk = '' + x
		while t > 1:
			tk += x
			t -= 1
		n = n - b * tro
	tk += x[:n]
	print(tk)


import sys
input = sys.stdin.readline
t = int(input())
letters = 'abcdefghijklmnopqrstuvwxyz'
for i in range(t):
	(n, a, b) = [int(i) for i in input().strip().split()]
	string = letters[:b]
	string += 'a' * (a - b)
	while len(string) < n:
		string += string
	string = string[:n]
	print(string)


import string
import random
alphabets = list(string.ascii_lowercase)
t = int(input())
for i in range(t):
	(x0, y0, z0) = input().split(' ')
	(n, a, b) = (int(x0), int(y0), int(z0))
	for i in range(n):
		print(alphabets[i % b], end='')
	print()


t = int(input())
while t:
	t -= 1
	(n, a, b) = list(map(int, input().split()))
	arr = []
	for i in range(b):
		arr.append(chr(i + ord('a')))
	for i in range(b, a):
		arr.append(chr(ord('a') + b - 1))
	for i in range(n):
		print(arr[i % a], end='')
	print(' ')


import os
import sys
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))
input = lambda : sys.stdin.readline().rstrip('\r\n')
from math import gcd, ceil

def prod(a, mod=10 ** 9 + 7):
	ans = 1
	for each in a:
		ans = ans * each % mod
	return ans

def lcm(a, b):
	return a * b // gcd(a, b)

def binary(x, length=16):
	y = bin(x)[2:]
	return y if len(y) >= length else '0' * (length - len(y)) + y
for _ in range(int(input()) if True else 1):
	(n, a, b) = map(int, input().split())
	ans = [''] * n
	x = 0
	for i in range(a):
		if i <= a - b:
			ans[i] = 'a'
		else:
			x += 1
			ans[i] = chr(97 + x)
	x = 0
	for i in range(a, n):
		ans[i] = chr(97 + x % b)
		x += 1
	print(*ans, sep='')


for _ in range(int(input())):
	(n, a, b) = map(int, input().split())
	s = ''
	j = 97
	count = 0
	for i in range(n):
		s += chr(j)
		j += 1
		count += 1
		if count == b:
			count = 0
			j = 97
	print(s)


letters = 'abcdefghijklmnopqrstuvwxyz'
t = int(input())
for _ in range(t):
	i = input().split(' ')
	(n, a, b) = (int(i[0]), int(i[1]), int(i[2]))
	subs = letters[:b]
	res = subs * (n // b)
	res += subs[:n % b]
	print(res)


t = int(input())
for i in range(t):
	l = list(map(int, input().strip().split()))
	n = l[0]
	a = l[1]
	b = l[2]
	for j in range(n):
		print(chr(97 + (a + j) % b), end='')
	print()


def sol(n, a, b):
	ans = ''
	tot = 0
	while tot < n:
		for i in range(b):
			ans += chr(97 + i)
			tot += 1
	ans = ans[:n]
	print(ans)
	return
for t in range(int(input())):
	(n, a, b) = map(int, input().split())
	sol(n, a, b)


import sys
input = sys.stdin.buffer.readline

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

def mult_input():
	return map(int, input().split())
for nt in range(int(input())):
	(n, a, b) = mult_input()
	ans = 'a' * (a - b + 1)
	for i in range(b - 1):
		ans += chr(98 + i)
	s = ''
	for i in range(n // a):
		s += ans
	s += ans[0:n % a]
	print(s)


from string import ascii_lowercase
from io import StringIO
from sys import stdin, stdout
lowercase = ascii_lowercase
t = int(stdin.readline().strip())
input = [list(map(int, line.split())) for line in stdin.readlines()]
for line in input:
	(n, a, b) = line
	for i in range(n):
		stdout.write(lowercase[i % b])
	stdout.write('\n')


import sys
input = sys.stdin.readline
import heapq
import copy
import math

def inp():
	return int(input())

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

def insr():
	s = input()
	return list(s[:len(s) - 1])

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

class Node:

	def _init_(self, val):
		self.data = val
		self.left = None
		self.right = None

class fen_tree:

	def __init__(self, list):
		self.array = [0] + list
		for idx in range(1, len(self.array)):
			idx2 = idx + (idx & -idx)
			if idx2 < len(self.array):
				self.array[idx2] += self.array[idx]

	def prefix_query(self, idx):
		result = 0
		while idx:
			result += self.array[idx]
			idx -= idx & -idx
		return result

	def prints(self):
		print(self.array)
		return

	def range_query(self, from_idx, to_idx):
		return self.prefix_query(to_idx) - self.prefix_query(from_idx - 1)

	def update(self, idx, add):
		while idx < len(self.array):
			self.array[idx] += add
			idx += idx & -idx

def pre_sum(arr):
	p = [0]
	for i in arr:
		p.append(p[-1] + i)
	p.pop(0)
	return p

def pre_back(arr):
	p = [0]
	for i in arr:
		p.append(p[-1] + i)
	p.pop(0)
	return p

def bin_search(arr, l, r, val):
	if arr[r] <= val:
		return r + 1
	if r - l < 2:
		if arr[l] > val:
			return l
		else:
			return r
	mid = int((l + r) / 2)
	if arr[mid] <= val:
		return bin_search(arr, mid, r, val)
	else:
		return bin_search(arr, l, mid, val)

def search_leftmost(arr, val):

	def helper(arr, l, r, val):
		print(l, r)
		if arr[l] == val:
			return l
		if r - l <= 1:
			if arr[r] == val:
				return r
			else:
				print('not found')
				return
		mid = int((r + l) / 2)
		if arr[mid] >= val:
			return helper(arr, l, mid, val)
		else:
			return helper(arr, mid, r, val)
	return helper(arr, 0, len(arr) - 1, val)

def search_rightmost(arr, val):

	def helper(arr, l, r, val):
		print(l, r)
		if arr[r] == val:
			return r
		if r - l <= 1:
			if arr[l] == val:
				return r
			else:
				print('not found')
				return
		mid = int((r + l) / 2)
		if arr[mid] > val:
			return helper(arr, l, mid, val)
		else:
			return helper(arr, mid, r, val)
	return helper(arr, 0, len(arr) - 1, val)

def pr_list(a):
	print(*a, sep=' ')

def main():
	tests = inp()
	mod = 1000000007
	limit = 10 ** 18
	for test in range(tests):
		[n, a, b] = inlt()
		win = [chr(i + ord('a')) for i in range(26)]
		ans = ''
		for i in range(n):
			ans = ans + win[i % b]
		print(ans)
main()


import sys
input = sys.stdin.readline
s = 'abcdefghijklmonpqrstuvwxyz'
for _ in range(int(input())):
	(n, a, b) = map(int, input().split())
	st = s[:b] * n
	print(st[:n])


for _ in range(int(input())):
	(n, a, b) = list(map(int, input().split()))
	x = 'a'
	l = [chr(i + 97) for i in range(b)]
	l.extend([l[-1] for i in range(a - b)])
	j = 0
	for i in range(n - a):
		l.append(l[j])
		j += 1
	print(''.join(l))


from string import ascii_letters as alphabet
alph = alphabet[:26]
t = int(input())
for i in range(t):
	s = ''
	(n, a, b) = map(int, input().split())
	step = a - b
	word = alph[:b]
	while len(s) < n:
		s += word + 'a' * step
	print(s[:n])


from math import ceil, gcd, floor, log
from collections import deque, defaultdict as dict
from heapq import heappush as hpush, heappop as hpop, heapify
from functools import lru_cache
import sys

def inpi():
	return int(input())

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

def inp():
	s = input()
	return list(s)

def inpv():
	return map(int, input().split())
l = 'abcdefghijklmnopqrstuvwxyz'
testcase = int(input())
for test in range(testcase):
	(n, a, b) = inpv()
	s = l[:b]
	k = n // b
	ans = s * k
	ans += s[:n % b]
	print(ans)


def make_smallstr(aa, bb) -> str:
	return alphabet[:bb] * (aa // bb) + alphabet[:aa % bb]
import string
alphabet = string.ascii_lowercase
num = int(input())
for i in range(num):
	inp = input().split(' ')
	n = int(inp[0])
	a = int(inp[1])
	b = int(inp[2])
	understr = make_smallstr(a, b)
	ans = understr * (n // a) + understr[:n % a]
	print(ans)


t = int(input())
for _ in range(t):
	(n, a, b) = map(int, input().split())
	a = [chr(i) for i in range(ord('a'), ord('z') + 1)]
	c = ''
	for i in range(b):
		c += a[i]
	ans = c * (n // b) + c[:n % b]
	print(ans)


def printing(s):
	for i in s:
		print(i, end='')
	print('')
for _ in range(int(input())):
	(n, a, b) = map(int, input().split())
	alpha = ''
	for i in range(97, 97 + b):
		alpha += chr(i)
	lol = ''
	while len(lol) <= a:
		lol += alpha
	ans = ''
	while len(ans) <= n:
		ans += lol
	if len(ans) == n:
		printing(ans)
	else:
		while len(ans) > n:
			ans = ans[:-1]
		printing(ans)


s = 'abcdefghijklmnopqrstuvwxyz'
for i in range(int(input())):
	(n, a, b) = map(int, input().split())
	c = ''
	for j in range(n):
		c += s[j % b]
	print(c)


h = int(input())
all_alph = []
for i in range(97, 97 + 26):
	all_alph.append(chr(i))
while h:
	(a, b, c) = map(int, input().rstrip().split(' '))
	z = ''.join(all_alph[:c])
	if a % c:
		print(z * (a // c) + z[:a % c])
	else:
		print(z * (a // c))
	h = h - 1


MOD = 1000000007
ii = lambda : int(input())
si = lambda : input()
dgl = lambda : list(map(int, input()))
f = lambda : map(int, input().split())
il = lambda : list(map(int, input().split()))
ls = lambda : list(input())
from collections import *
for _ in range(ii()):
	(n, a, b) = f()
	c = []
	for i in range(0, n):
		c.append(chr(97 + i % b))
	print(''.join(c))


from math import ceil, sqrt, floor, sqrt
import collections
from typing import List
from fractions import gcd
from collections import deque
from collections import defaultdict
t = int(input())
for _ in range(t):
	(n, a, b) = list(map(int, input().split()))
	alphabets = ''.join([chr(ord('a') + i) for i in range(26)])
	astr = ''.join([alphabets[i % b] for i in range(a)])
	res = astr * int(ceil(n / a))
	res = res[:n]
	print(res)


import sys
import math

def solve():
	(n, a, b) = map(int, input().split())
	subs = ''
	c = 'a'
	cnt = 0
	for i in range(b):
		subs += c
		c = chr(ord(c) + 1)
		cnt += 1
	while cnt < a:
		subs += subs[-1]
		cnt += 1
	q = n // a
	r = n % a
	res = q * subs
	res += subs[:r]
	print(res)
test_cases = int(input())
for _ in range(test_cases):
	solve()


t = int(input())
eng = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
for i in range(t):
	(n, a, b) = map(int, input().split())
	output_str = ''
	cnt = []
	for j in range(a):
		if len(cnt) == b:
			output_str = output_str + cnt[0]
		else:
			output_str = output_str + eng[j]
			cnt.append(eng[j])
	for j in range(1, n - a + 1):
		cnt = []
		for z in range(j, len(output_str)):
			cnt.append(output_str[z])
		cnt = list(set(cnt))
		if len(cnt) == b:
			output_str = output_str + cnt[0]
		else:
			for k in range(26):
				if eng[k] in cnt:
					continue
				else:
					output_str = output_str + eng[k]
					break
	print(output_str)


import string
alph = string.ascii_lowercase
s = []
n = int(input())
for i in range(n):
	s = input().split()
	line = ''
	for y in range(int(s[0])):
		for j in range(int(s[2])):
			line += alph[j]
	print(line[0:int(s[0])])


from collections import defaultdict, deque
from heapq import heappush, heappop
from itertools import permutations, accumulate
import sys
import math
import bisect

def LI():
	return [int(x) for x in sys.stdin.readline().split()]

def I():
	return int(sys.stdin.readline())

def LS():
	return [list(x) for x in sys.stdin.readline().split()]

def S():
	res = list(sys.stdin.readline())
	if res[-1] == '\n':
		return res[:-1]
	return res

def IR(n):
	return [I() for i in range(n)]

def LIR(n):
	return [LI() for i in range(n)]

def SR(n):
	return [S() for i in range(n)]

def LSR(n):
	return [LS() for i in range(n)]
sys.setrecursionlimit(1000000)
mod = 1000000007

def solve():
	t = I()
	for _ in range(t):
		(n, a, b) = LI()
		for i in range(n):
			print(chr(i % b + ord('a')), end='')
		print()
	return
solve()


t = int(input())
for j in range(t):
	(n, a, b) = tuple(map(int, input().split()))
	s = list()
	for i in range(n):
		s.append(chr(97 + i % b))
	print(''.join(s))


t = int(input())
for i in range(t):
	(n, a, b) = [int(x) for x in input().split()]
	for j in range(n):
		print(chr(97 + j % b), end='')
	print()


import math
alph = 'abcdefghijklmnopqrstuvwxyz'
t = int(input())
for i in range(t):
	(n, a, b) = map(int, input().split())
	f = alph[0:b]
	f = f * (n // b + 1)
	f = f[0:n]
	print(f)


import math
t = int(input())
for i in range(t):
	(n, a, b) = [int(i) for i in input().split()]
	s = ''
	ss = 'abcdefghijklmnopqrstuvwxyz'[:b]
	print((ss * math.ceil(n / b))[:n])


t = int(input())
import random
while t > 0:
	(n, a, b) = list(map(int, input().split()))
	use = ''
	uc = 0
	while len(use) < a:
		x = chr(random.randint(ord('a'), ord('z')))
		if not x in use:
			uc += 1
			use += x
		if uc == b:
			break
	while len(use) < a:
		use = use + use[-1]
	ans = use
	i = len(ans)
	while i < n:
		x = ans[i - a]
		ans = ans + x
		i = i + 1
	print(ans)
	t = t - 1


t = int(input())
while t:
	(a, b, c) = list(map(int, input().split()))
	s = ''
	sub = [chr(97 + i) for i in range(c)]
	p = a % c
	q = a // c
	s = sub * q + sub[:p]
	s = ''.join(s)
	print(s)
	t -= 1


t = int(input())
for _ in range(t):
	(n, a, b) = map(int, input().split())
	s = 'abcdefghijklmnopqrstuvwxyz'
	dis = s[0:b]
	l = len(dis)
	while len(dis) <= n:
		dis += dis
	dis = dis[:n]
	print(dis)


k = int(input())
for _ in range(k):
	(n, a, b) = [int(i) for i in input().split()]
	out = ''
	bCopy = b
	aCopy = a
	while n > 0:
		out += chr(96 + b)
		a -= 1
		if b > 1:
			b -= 1
		if a == 0:
			b = bCopy
			a = aCopy
		n -= 1
	print(out)


for _ in ' ' * int(input()):
	(a, b, c) = map(int, input().split())
	k = 'abcdefghijklmnopqrstuvwxyz'
	s = k[:c]
	s = s * (b // c) + s[:b % c]
	while a - b >= 0:
		print(s, end='')
		a -= b
	print(s[:a])


import sys
import string
num_of_test_cases = int(input())
test_cases = map(lambda inp: list(map(int, inp.split())), sys.stdin.readlines())
u = string.ascii_lowercase

def pos_or_zero(i):
	if i < 0:
		return 0
	else:
		return i

def unseen_elem(univ, prev_set):
	for x in univ:
		if x not in prev_set:
			return x
	raise Exception('impossible state: universe exhausted')

def f(n, a, b):
	l = n * [None]
	for i in range(0, n):
		prev_set = set(l[pos_or_zero(i - a + 1):i])
		if len(prev_set) == b:
			l[i] = l[pos_or_zero(i - a + 1)]
		else:
			l[i] = unseen_elem(u, prev_set)
	return l
results = map(lambda x: ''.join(map(str, f(x[0], x[1], x[2]))), test_cases)
for r in results:
	print(r)


import string
letters = string.ascii_lowercase
for _ in range(int(input())):
	(n, a, b) = map(int, input().split())
	use = letters[1:b]
	ans = 'a' * (a - b + 1) + use
	i = 0
	j = 0
	while len(ans) != n:
		if ans[i] == 'a':
			ans += 'a'
		else:
			ans += use[j]
			if j == b - 2:
				j = 0
			else:
				j += 1
		i += 1
	print(ans)


t = int(input())
for i in range(t):
	(n, a, b) = input().split()
	str = ''
	x = 97
	for i in range(int(b) - 1):
		str = str + chr(x)
		x = x + 1
	for i in range(int(a) - int(b) + 1):
		str = str + chr(x)
	if int(n) - int(a) < int(a):
		a = str * 2
		print(a[0:int(n)])
	else:
		l = int(n) // int(a) + 1
		a = str * l
		print(a[0:int(n)])


from math import *
t = int(input())
for i in range(t):
	DICT = 'abcdefghijklmnopqrstuvwxyz'
	(n, a, b) = list(map(int, input().split()))
	if a == b:
		LL = ''
		for j in range(n):
			LL += DICT[j % 26]
		print(LL)
	else:
		c = list(DICT[:b])
		LL = ''
		for j in range(n):
			LL += c[j % b]
		print(LL)


import string
for i in range(int(input())):
	(n, a, b) = [int(a) for a in input().split()]
	s = string.ascii_lowercase[:b] + string.ascii_lowercase[b - 1] * (a - b)
	print((s * n)[:n])


l = 'abcdefghijklmnopqrstuvwxyz'
for _ in range(int(input())):
	(n, a, b) = map(int, input().split())
	z = a - b
	s = l[:b] + l[0] * z
	p = n // a
	p1 = n % a
	x = s * p
	x += s[:p1]
	print(x)


t = int(input())
l = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
for _ in range(t):
	ans = []
	(n, a, b) = map(int, input().split())
	(count, flag) = (0, 0)
	while count <= n:
		for i in range(0, b):
			count += 1
			if count > n:
				flag = 1
				break
			ans.append(l[i])
		if flag == 1:
			break
	s2 = ''.join([str(a) for a in ans])
	print(s2)


t = int(input())
for i in range(t):
	(n, a, b) = [int(x) for x in input().split()]
	s = ''
	template = ''
	start = 97
	tl = 0
	while tl < a:
		ch = start + tl % b
		template += chr(ch)
		tl += 1
	s = template
	while tl < n:
		flag = 0
		for c in template:
			if c not in s[tl - a + 1:tl]:
				s += c
				flag = 1
				tl += 1
				break
		if flag == 0:
			s += chr(start)
			tl += 1
	print(s)


t = int(input())
for i in range(t):
	(n, a, b) = [int(i) for i in input().split()]
	dif = a - b + 1
	x = 97
	one = dif * chr(97)
	for j in range(b - 1):
		x += 1
		one += chr(x)
	len1 = (n + a - 1) // a
	two = one * len1
	ans = two[:n]
	print(ans)


def solve():
	(n, a, b) = [int(x) for x in input().split()]
	lim = ord('a') + b - 1
	string = ''
	for i in range(ord('a'), lim + 1):
		string += chr(i)
	diff = a - b
	k = 0
	component = string
	for i in range(diff):
		component = component + string[k]
		if k == b - 1:
			k = 0
		else:
			k += 1
	diff_2 = n - a
	final = component
	k = 0
	for i in range(diff_2):
		final = final + component[k]
		if k == a - 1:
			k = 0
		else:
			k += 1
	print(final)
t = int(input())
for i in range(t):
	solve()


from string import ascii_lowercase as alpha
for _ in range(int(input())):
	(n, a, b) = (int(x) for x in input().split())
	ans = ''
	sub = alpha[:b] + alpha[b - 1] * (a - b)
	for _ in range(n // a):
		ans += sub
	ans += sub[:n % a]
	print(ans)


for _ in range(int(input())):
	(n, a, b) = map(int, input().split())
	res = ''
	res = res + 'a' * (a - b)
	for i in range(97, 97 + b, 1):
		res += chr(i)
	tims = n // a
	main = ['0'] * n
	k = 0
	for i in range(tims + 1):
		j = 0
		while j < a and k < n:
			main[k] = res[j]
			k += 1
			j += 1
	print(''.join(main))


for _ in range(int(input())):
	(n, a, b) = map(int, input().split())
	sub = ['a'] * a
	for i in range(b):
		sub[i] = chr(ord('a') + i)
	for i in range(b, a):
		sub[i] = sub[i - b]
	print(''.join(sub * (n // a) + sub[:n % a]))


tests = int(input())
letters = 'abcdefghijklmnopqrstuvwxyz'
for _ in range(tests):
	(n, a, b) = [int(x) for x in input().split()]
	reps = n // b
	rem = n % b
	let_slice = letters[:b]
	result = let_slice * reps
	result += let_slice[:rem]
	print(result)


import sys
import string
alph = list(string.ascii_lowercase)

def solve(arr):
	strlen = arr[0]
	sublen = arr[1]
	count = arr[2]
	ret = ''
	ctrack = 0
	for i in range(strlen):
		ret += alph[ctrack]
		ctrack += 1
		if ctrack == count:
			ctrack = 0
		if ctrack == sublen:
			ctrack = 0
	return ret

def main():
	q = []
	for line in sys.stdin.readlines():
		q.append(line)
	for i in range(len(q)):
		q[i] = q[i].rstrip().split(' ')
		q[i] = [int(x) for x in q[i]]
	for i in range(1, len(q)):
		ret = solve(q[i])
		print(ret)
main()


T = int(input())
out = []
letter = []
alpha = 'a'
for i in range(26):
	letter.append(alpha)
	alpha = chr(ord(alpha) + 1)
for i in range(T):
	(n, a, b) = map(int, input().split())
	temp_str = ''.join(letter[0:b])
	str = ''
	while len(str) <= n:
		str = str + temp_str
	out.append(str[0:n])
for i in range(T):
	print(out[i])


t = int(input())
for _ in range(t):
	(n, a, b) = map(int, input().split())
	x = 97
	s = ''
	for i in range(b):
		s += chr(x)
		x += 1
	s1 = ''
	s1 = n // b * s + s[:n % b]
	print(s1)


import string
for _ in range(int(input())):
	(n, a, b) = map(int, input().split())
	alphas = string.ascii_lowercase[:b]
	alphas = alphas * (a // b) + alphas[:a % b]
	print(alphas * (n // a) + alphas[:n % a])


import math
s = 'abcdefghijklmnopqrstuvwxyz'
N = int(input())
for i in range(0, N):
	(n, a, b) = map(int, input().split())
	x = []
	y = []
	for j in range(0, a - b):
		x.append('a')
	for j in range(0, b):
		x.append(s[j])
	for j in range(0, n):
		y.append(x[j % a])
	y = ''.join(y)
	print(y)


from string import ascii_lowercase
d = ascii_lowercase
cases = int(input())
for _ in range(cases):
	(n, a, b) = map(int, input().split())
	if a == b:
		w = ''
		for i in range(n):
			w += d[i % 26]
		print(w)
	else:
		w = ''
		w += (a - b + 1) * 'a'
		index = 1
		for i in range(a - len(w)):
			w += d[index % 26]
			index += 1
		gg = n // len(w)
		mm = n % len(w)
		print(w * gg + w[:mm])


alpha = list('abcdefghijklmnopqrstuvwxyz')
for _ in range(int(input())):
	(n, a, b) = list(map(int, input().split()))
	sub_seq = []
	temp = alpha[:b]
	for _ in range(a // b + 1):
		sub_seq.extend(temp)
	sub_seq = sub_seq[:a]
	final = []
	for _ in range(n // a + 1):
		final.extend(sub_seq)
	final = final[:n]
	print(''.join(final))


nt = int(input())
alpha = 'a'
l = []
for i in range(0, 26):
	l.append(alpha)
	alpha = chr(ord(alpha) + 1)
for c in range(nt):
	(n, a, b) = map(int, input().split())
	if a == b:
		m = a + 1
		p = l[0:m]
	else:
		m = b
		p = l[0:m]
	count = 0
	x = p.copy()
	p = ''
	for i in x:
		p += i
	while count + len(p) <= n:
		print(p, end='')
		count += len(p)
	print(p[0:n - count], end='')
	print()


for _ in range(int(input())):
	(a, b, c) = map(int, input().split())
	s = ''
	p = 97
	for i in range(a):
		s += chr(97 + i % c)
	print(s)


for _ in range(int(input())):
	(n, a, b) = map(int, input().split())
	for i in range(n // b):
		for j in range(b):
			print(chr(97 + j), end='')
	for i in range(n % b):
		print(chr(97 + i), end='')
	print()


t = int(input())
while t:
	(n, a, b) = map(int, input().split())
	d = a - b
	alph = 97
	k = 0
	print(chr(alph), end='')
	for i in range(2, n + 1):
		if d == 0:
			alph += 1
		elif (i - 1) % b == 0:
			alph = 97
		else:
			alph += 1
		if alph >= 123:
			alph = 97
		print(chr(alph), end='')
	print(end='\n')
	t = t - 1


letters = 'abcdefghijklmnopqrstuvwxyz'
t = int(input())
for i in range(t):
	(n, a, b) = [int(x) for x in input().split()]
	s = ''
	while len(s) <= n:
		cpy = letters[:b] * a
		for i in range(a):
			s += cpy[i]
	print(s[:n])


t = int(input())
while t:
	(n, a, b) = map(int, input().split())
	limit = n
	flag = 0
	for r in range(n):
		for x in range(b):
			print(chr(x + 97), end='')
			limit -= 1
			if limit == 0:
				print()
				flag = 1
				break
		if flag:
			break
	t -= 1


import string
t = int(input())
for _ in range(t):
	(n, a, b) = map(int, input().split())
	s = ''
	for i in range(n):
		s += string.ascii_lowercase[i % b]
	print(s)


t = int(input())
for i in range(t):
	s = str(input()).split()
	n = int(s[0])
	a = int(s[1])
	b = int(s[2])
	s = ''
	for j in range(n):
		s += chr(97 + (a + j) % b)
	print(s)


t = int(input())
while t > 0:
	t -= 1
	(n, a, b) = map(int, input().split())
	alpha = list(map(chr, range(97, 123)))
	s = ''
	i = 0
	j = 0
	k = 0
	while j < n:
		if k < b:
			s = s + alpha[k]
			k += 1
		else:
			k = 0
			s = s + alpha[k]
			k += 1
		j += 1
	print(s)


alphabet = [chr(i) for i in range(97, 123)]
t = int(input())
for _ in range(t):
	(n, a, b) = map(int, input().split())
	string2 = [alphabet[i] for i in range(b)]
	string = ''
	for i in string2:
		string += i
	string *= n // b + 5
	print(string[:n])


t = int(input())
for _ in range(t):
	(n, a, b) = map(int, input().split())
	l = list(map(lambda x: chr(x + ord('a')), range(b)))
	r = [*l] + [l[-1]] * max(0, a - b)
	r *= max(1, 1 + n // len(r))
	print(''.join(r[:n]))


t = int(input())
for _ in range(t):
	(n, a, b) = list(map(int, input().split()))
	j = 0
	i = 0
	p = ''
	q = 97
	i = 0
	while i < b:
		p += chr(q)
		q += 1
		i += 1
	q = 97
	p += (a - b) * chr(q)
	j = n - a
	if j < a:
		p += p[:j]
	else:
		while j > a:
			p += p[:a]
			j -= a
		p += p[:j]
	print(p)


t = int(input())
test_list = []
test_list = [chr(x) for x in range(ord('a'), ord('z') + 1)]
for t1 in range(t):
	(n, a, b) = [int(n1) for n1 in input().split()]
	test1 = test_list[:b]
	test2 = test1 * int(a / len(test1)) + test1[:a % len(test1)]
	test3 = test2 * int(n / len(test2)) + test2[:n % len(test2)]
	print(*test3, sep='')


import sys
import math
input = sys.stdin.readline

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

def str_array():
	return list(map(str, input().split()))
abc = []
for i in range(97, 97 + 26):
	abc.append(chr(i))
for i in range(int(input())):
	(n, a, b) = int_array()
	for _ in range(n):
		thing = abc[:b] * (n // b + n % b)
		ans = thing[:n]
	print(''.join(ans))


refr = 'abcdefghijklmnopqrstuvwxyz'
query = int(input())
for i in range(query):
	(n, a, b) = map(int, input().split())
	s = ''
	i = 0
	while i < n:
		if i + b < n:
			for j in range(b):
				s += refr[j]
			i += b
		else:
			for j in range(n - i):
				s += refr[j]
			i += n - i
	print(s)


for i in range(int(input())):
	(n, a, b) = map(int, input().split())
	answer = ''
	letters = 'abcdefghijklmnopqrstuvwxyz'
	letters2 = letters[:b]
	k = n // b
	answer = letters2 * k + letters[:n % b]
	print(answer)


import string
t = int(input())
ref = string.ascii_lowercase
count = 0
ans = []
while count < t:
	(n, a, b) = input().split()
	ans2 = ref[:int(b)]
	times = int(n) // int(b)
	left = int(n) - times * int(b)
	ans2 *= times
	if left > 0:
		ans2 += ans2[:left]
	ans.append(ans2)
	count += 1
for y in ans:
	print(y)


t = int(input())
for _ in range(t):
	letters = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
	(n, a, b) = list(map(int, input().split()))
	s = []
	blet = []
	while b > 0:
		blet.append(letters[0])
		letters.remove(letters[0])
		b -= 1
	while len(s) + len(blet) <= n:
		for i in range(len(blet)):
			s.append(blet[i])
	j = 0
	while len(s) < n:
		s.append(blet[j])
		j += 1
	print(''.join(s))


n = int(input())
inp = []
for i in range(0, n):
	inp.append(list(map(int, input().strip().split())))
for i in range(0, n):
	string = ''
	unique = 0
	for j in range(0, inp[i][0]):
		if j < inp[i][1]:
			if unique < inp[i][2]:
				string += chr(97 + j)
				unique += 1
			else:
				string += chr(97)
		else:
			string += string[j - inp[i][1]]
	print(string)


def makeString(n, a, b):
	i = 97
	s = ''
	j = 1
	while n > 0:
		while j % (b + 1) != 0 and n > 0:
			s += chr(i)
			i += 1
			j += 1
			n -= 1
		else:
			i = 97
			j = 1
	print(s)

def main():
	t = int(input())
	for i in range(t):
		(n, a, b) = tuple(map(int, input().split()))
		makeString(n, a, b)
main()


t = int(input())
for i in range(t):
	alph = 'abcdefghijklmnopqrstuvwxyz'
	(n, a, b) = [int(j) for j in input().split()]
	s = ''
	uniq = alph[:b]
	some = 'a' * (a - b)
	template = some + uniq
	count = n // a if n % a == 0 else n // a + 1
	res1 = template * count
	print(res1[:n])


test_list = [chr(x) for x in range(ord('a'), ord('z') + 1)]
for _ in range(int(input())):
	(x, y, z) = map(int, input().split())
	temp = ''
	for i in range(z):
		temp = temp + test_list[i]
	temp = temp * x
	temp = temp[:x]
	print(temp)


import sys
from math import sqrt, floor, ceil
from collections import deque, Counter
inp = sys.stdin.readline
read = lambda : list(map(int, inp().split()))

def a():
	ans = ''
	for _ in range(int(inp())):
		n = int(inp())
		res = abs(n - 1 - ceil(n / 2) + n % 2)
		ans += str(res) + '\n'
	print(ans)

def b():
	ans = ''
	alph = 'abcdefghijklmnopqrstuvwxyz'
	for _ in range(int(inp())):
		(n, a, b) = read()
		seq = alph[:b] + alph[:b] * ((a - b) // b) + alph[:b][:(a - b) % b]
		res = seq * (n // a) + seq[:n % a]
		ans += res + '\n'
	print(ans)
b()


t = int(input())
for q in range(t):
	(n, a, b) = list(map(int, input().split(' ')))
	s = ''
	caractere = 97
	for k in range(n):
		s += chr(caractere)
		caractere += 1
		if caractere > 97 + (b - 1) or caractere > 122:
			caractere = 97
	print(s)


t = int(input())
for z in range(t):
	(n, a, b) = [int(i) for i in input().split()]
	x = 'abcdefghijklmnopqrstuvwxyz'[:b - 1]
	x += (a - b + 1) * 'abcdefghijklmnopqrstuvwxyz'[b - 1:b]
	y = n // a + 1
	x = x * y
	x = x[:n]
	print(x)


t = int(input())
for i in range(t):
	(n, a, b) = map(int, input().split())
	j = 97
	x = ''
	s = b
	ans = ''
	w = n
	while s > 0:
		e = chr(j)
		x += e
		j += 1
		s -= 1
	while n > 0:
		ans += x
		n -= b
		ans = ans[:w]
	print(ans)


import sys
T = int(sys.stdin.readline())
for _ in range(T):
	(n, a, b) = map(int, sys.stdin.readline().split())
	list_word = [chr(97 + i) for i in range(b)]
	list_result = []
	index = 0
	while index < n:
		list_result.append(list_word[index % b])
		index += 1
	print(''.join(list_result))


from sys import stdin, stdout
t = stdin.readline
f = stdout.writelines
for _ in range(int(t())):
	(n, a, b) = map(int, t().split())
	for i in range(n):
		f('{}'.format(chr(97 + i % b)))
	f('{}\n'.format(''))


def main():
	t = int(input())
	for _ in range(1, t + 1):
		(n, a, b) = [int(i) for i in input().split(' ')]
		alpha = [chr(i) for i in range(ord('a'), ord('a') + b + 1)]
		s = [alpha[i % b] for i in range(n)]
		print(*s, sep='')
main()


import sys
from collections import deque
alf = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
input = lambda : sys.stdin.readline().strip()
ipnut = input
n = int(input())
for i in range(n):
	(q, a, b) = map(int, input().split())
	ans = []
	t = 0
	for i in range(q):
		if i < a:
			ans.append(alf[min(t, b - 1)])
			if t < b:
				t += 1
		else:
			ans.append(ans[-a])
	print(''.join(ans))


from string import ascii_letters
from math import ceil
I = input
for _ in range(int(I())):
	(n, a, b) = map(int, I().split())
	s = ascii_letters[:26]
	p = s[:b]
	print((p * ceil(n / len(p)))[:n])


letters = ''.join((chr(ord('a') + x) for x in range(26)))
for t in range(int(input())):
	(n, a, b) = map(int, input().split())
	s = 'a' * (a - b) + letters[:b]
	print((s * (n // a + 1))[:n])


t = int(input())
for _ in range(t):
	(n, a, b) = list(map(int, input().split()))
	ss = 'abcdefghijklmnopqrstuvwxyz'
	ss = ss[0:b]
	res = ss + (a - b) * 'a'
	print(n // a * res + res[0:n % a])


import math
testcases = int(input())
alphabet = 'abcdefghijklmnopqrstuvwxyz'
for i in range(testcases):
	line = input()
	(n, a, b) = (int(s) for s in line.split())
	string = ''
	c = math.floor(n / b)
	for i in range(c):
		for i in range(b):
			string = string + alphabet[i]
	for i in range(n - len(string)):
		string = string + alphabet[i]
	print(string)


_ORD_A = ord('a')

def getNextLetter(currentLetter, b):
	currentLetterOrd = ord(currentLetter)
	currentLetterIndex = currentLetterOrd - _ORD_A
	nextLetterIndex = currentLetterIndex + 1
	if nextLetterIndex > b - 1:
		nextLetterIndex = 0
	nextLetterIndex
	return chr(nextLetterIndex + _ORD_A)

def makeString(n, b):
	answer = ''
	currentLetter = 'a'
	for i in range(n):
		answer += currentLetter
		currentLetter = getNextLetter(currentLetter, b)
	return answer
t = int(input())
testcaseList = []
for testcaseIndex in range(t):
	(n, a, b) = map(int, input().split())
	testcaseList.append([n, a, b])
for (n, a, b) in testcaseList:
	print(makeString(n, b))


test_case = int(input())
alp = 'abcdefghijklmnopqrstuvwxyz'
for _ in range(test_case):
	(n, a, b) = list(map(int, input().split()))
	b_string = alp[0:b]
	ans = b_string * (n // b)
	ans = ans + b_string[0:n % b]
	print(ans)


t = int(input())
for i in range(t):
	d = 'abcdefghijklmnopqrstuvwxyz'
	(n, a, b) = map(int, input().split())
	s = d[0:b]
	s = s * (n // b)
	s = s + s[0:n % b]
	print(s)


t = int(input())
for _ in range(t):
	(n, a, b) = map(int, input().split())
	c = 0
	while c < n:
		for i in range(97, 97 + b):
			print(chr(i), end='')
			c += 1
			if c >= n:
				break
	print(end='\n')


t = int(input())
for _ in range(t):
	(n, a, b) = [int(x) for x in input().split()]
	s = [chr(ord('a') + i % b) for i in range(n)]
	print(*s, sep='')


for _ in range(int(input())):
	(n, a, b) = map(int, input().split())
	s = ''
	while len(s) < n:
		s += ''.join([chr(ord('a') + i) for i in range(b)]) + chr(ord('a') + b - 1) * (a - b)
	print(s[:n])


from collections import Counter

def main():
	t = int(input())
	while t > 0:
		(n, a, b) = map(int, input().split())
		alpha = 'abcdefghijklmnopqrstuvwxyz'
		s = ''
		for i in range(a):
			s += alpha[i % b]
		count = 0
		for i in range(n - a):
			s += s[count]
			count += 1
		print(s)
		t -= 1
main()


t = int(input())
A = 'qwertyuiopasdfghjklzxcvbnm'
for i in range(t):
	(n, a, b) = map(int, input().strip().split())
	R = A[0:b]
	ANS = R * (n // b)
	ANS += R[0:n % b]
	print(ANS)


import sys
input = sys.stdin.readline
for _ in range(int(input())):
	(n, a, b) = map(int, input().split())
	s = [chr(97 + i) for i in range(b)]
	ans = ''.join(s) * (n // b) + ''.join(s[:n % b])
	print(ans)


t = int(input())
for i in range(t):
	temp = input().split()
	n = int(temp[0])
	a = int(temp[1])
	b = int(temp[2])
	s = ''
	for i in range(b):
		s += chr(i + 97)
	if a % b == 0:
		s = s * int(a / b)
	else:
		s = s * (a // b + 1)
	while len(s) < n:
		s = s + s
	print(s[:n])


import sys
input = sys.stdin.readline
INF = 2 ** 62 - 1

def read_int():
	return int(input())

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

def read_float():
	return float(input())

def read_float_n():
	return list(map(float, input().split()))

def read_str():
	return input().strip()

def read_str_n():
	return list(map(str, input().split()))

def error_print(*args):
	print(*args, file=sys.stderr)

def mt(f):
	import time

	def wrap(*args, **kwargs):
		s = time.time()
		ret = f(*args, **kwargs)
		e = time.time()
		error_print(e - s, 'sec')
		return ret
	return wrap

def slv(N, A, B):
	p = [chr(ord('a') + i) for i in range(B)] + ['a'] * (A - B)
	ans = []
	for _ in range(N // A + 1):
		ans.extend(p)
	return ''.join(ans[:N])

def main():
	T = read_int()
	for _ in range(T):
		(N, A, B) = read_int_n()
		print(slv(N, A, B))
main()


letters = 'abcdefghijklmnopqrstuvwxyz'
for _ in range(int(input())):
	(n, a, b) = map(int, input().split())
	d = n // b
	r = n % b
	s = letters[:b] * d
	s = s + letters[:r]
	print(s)


t = int(input())
while t > 0:
	(n, a, b) = map(int, input().split())
	if n == a and b == 1:
		print('a' * n)
		print('\n')
	else:
		s = ''
		for j in range(b):
			s = s + chr(97 + j)
		x = n // b
		d = n % b
		print(s * x, end='')
		if d != 0:
			for i in range(d):
				print(chr(97 + i), end='')
		print('\n')
	t = t - 1


t = int(input())
alpha = [chr(i) for i in range(97, 97 + 26)]
for test in range(t):
	(n, a, b) = map(int, input().split())
	scount = 0
	startcount = 1
	count = b
	string = ''
	for i in range(b):
		string += alpha[i]
	for i in range(a - b):
		string += alpha[scount]
	for _ in range(n - a):
		if len(set(string[startcount:])) == b:
			string += string[startcount]
		else:
			if count >= len(alpha):
				count = count % len(alpha)
			string += alpha[count]
			count += 1
		startcount += 1
	print(string)


t = int(input())
for k in range(t):
	donnees = input().split(' ')
	n = int(donnees[0])
	a = int(donnees[1])
	b = int(donnees[2])
	q = n // a
	r = n % a
	for l in range(q):
		compt = 0
		for j in range(a - b + 1):
			print(chr(97), end='')
		for z in range(b - 1):
			compt += 1
			print(chr(97 + compt), end='')
	compteur = 0
	while compteur <= a - b and compteur <= r - 1:
		print(chr(97), end='')
		compteur += 1
	compt2 = 1
	while compteur <= r - 1:
		print(chr(97 + compt2), end='')
		compt2 += 1
		compteur += 1
	print()


t = int(input())
p = []
for i in range(t):
	j = list(map(int, input().split()))
	p.append(j)

def minx(n, a, b):
	o = 65
	ans = ''
	while len(ans) <= n:
		o = 65
		for i in range(b):
			ans += chr(o)
			if len(ans) >= n:
				break
			o += 1
	return ans[:-1]
for i in range(t):
	y = minx(p[i][0], p[i][1], p[i][2])
	print(y.lower())


T = int(input())
for x in range(T):
	(N, A, B) = map(int, input().split())
	output = ''
	for i in range(N):
		output += chr(ord('a') + i % B)
	print(output)


import string
for t in range(int(input())):
	x = list(string.ascii_lowercase)
	(n, a, b) = map(int, input().strip().split())
	ans = []
	j = 0
	while b != 0:
		ans.append(x[j])
		a -= 1
		b -= 1
		j += 1
		n -= 1
	k = 0
	while n != 0:
		ans.append(ans[k])
		k += 1
		n -= 1
	print(''.join(ans))


al = 'abcdefghijklmnopqrstuvwxyz'
r = int(input())
for i in range(r):
	n_a_e = list(map(int, input().split()))
	n = n_a_e[0]
	a = n_a_e[1]
	e = n_a_e[2]
	word = ''
	w = 0
	for i in range(n):
		word += al[w]
		w += 1
		if w == e:
			w = 0
	print(word)


t = int(input())
for _ in range(t):
	(n, a, b) = map(int, input().split())
	ans = [''] * n
	c = 97
	j = 0
	for i in range(n):
		if j < b - 1:
			ans[i] = chr(c + j)
			j += 1
		else:
			ans[i] = chr(c + j)
			j = 0
	for i in ans:
		print(i, end='')
	print()


t = int(input())
s = 'abcdefghijklmnopqrstuvwxyz'
for tt in range(t):
	(n, a, b) = map(int, input().split())
	xx = s[0:b]
	ans = ''
	for i in range(n):
		ans += xx[i % b]
	print(ans)


n1 = int(input())
for i in range(n1):
	(n, a, b) = [int(v) for v in input().split()]
	l = []
	for j in range(b - 1):
		l.append(chr(97 + j))
	for k in range(a - b + 1):
		l.append('z')
	final = ''.join(l) * (n // len(l)) + ''.join(l[:n % len(l)])
	print(final)


t = int(input())
while t:
	(n, a, b) = tuple(map(int, input().split()))
	al = list('a b c d e f g h i j k l m n o p q r s t u v w x y z'.split())
	res = ''
	i = 0
	res = res.join(al[:b]) * (n // b)
	res += ''.join(al[:n % b])
	print(res)
	t -= 1


def solve(n, a, b):
	bCnt = 0
	ans = ''
	for i in range(n):
		bCnt = bCnt % b
		ans += chr(97 + bCnt)
		bCnt += 1
	return ans
numTestCase = int(input())
for t in range(numTestCase):
	(n, a, b) = map(int, input().split())
	print(solve(n, a, b))


from heapq import *
from collections import *
import os
import sys
from io import BytesIO, IOBase
import math
ins = lambda : [int(x) for x in input()]
inp = lambda : int(input())
inps = lambda : [int(x) for x in input().split()]

def main():
	t = inp()
	for i in range(t):
		(n, a, b) = inps()
		rep = (a + b - 1) // b
		if b == 1:
			print('a' * n)
		else:
			r = ''
			for i in range(b):
				r += chr(ord('a') + i)
			ans = r
			while len(ans) < n:
				ans += r
			print(ans[:n])
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))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


t = int(input())
for i in range(t):
	(a, b, c) = list(map(int, input().split()))
	ch = 'a'
	for j in range(int(a / c)):
		for k in range(c):
			d = chr(ord(ch) + k)
			print(d, end='')
	b = a - int(a / c) * c
	ch = 'a'
	for j in range(b):
		f = chr(ord(ch) + j)
		print(f, end='')
	print(' ')


s = 'abcdefghijklmnopqrstuvwxyz'
for _ in range(int(input())):
	(n, a, b) = map(int, input().split())
	x = a // b
	y = n // a
	for j in range(y):
		for i in range(x):
			print(s[:b], end='')
		print(s[:a % b], end='')
	x = n % a
	y = x // b
	for i in range(y):
		print(s[:b], end='')
	print(s[:x % b])


import math

def ii():
	return int(input())

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

def li():
	return list(mi())
for _ in range(ii()):
	(n, a, b) = mi()
	s = []
	for i in range(1):
		for j in range(b):
			s.append(chr(j + 97))
		for j in range(a - b):
			s.append(chr(97))
	for i in range(math.floor(n / a)):
		for j in range(a):
			print(s[j], end='')
	for i in range(n % a):
		if i == n % a - 1:
			print(s[i], end='')
			break
		print(s[i], end='')
	print()


T = int(input())
s = 'abcdefghijklmnopqrstuvwxyz'
s = list(s)
for t in range(T):
	(n, a, b) = map(int, input().split())
	r = s[:b] * (a // b + a)
	r = r[:a]
	for i in range(a, n):
		if len(set(r[i - a + 1:i])) < b:
			r.append((set(s) - set(r[i - a + 1:i])).pop())
		else:
			r.append(set(r[i - a + 1:i]).pop())
	print(''.join(r[:n]))


import string
alph = string.ascii_lowercase
t = int(input())
for _ in range(t):
	(n, a, b) = [int(s) for s in input().split()]
	res = ''
	while len(res) < n:
		res += alph[0:b]
	print(res[0:n])


t = int(input())
for i in range(1, t + 1):
	(n, b, a) = map(int, input().split())
	z = n % a
	string = []
	for k in range(n // a):
		for f in range(a):
			string.append(chr(97 + f))
	for d in range(z):
		string.append(chr(97 + d))
	print(''.join(string))


for _ in range(int(input())):
	(n, a, b) = list(map(int, input().split()))
	alpha_in = 'abcdefghijklmnopqrstuvwxyz'
	arr3 = list(alpha_in)
	result = []
	for i in range(n):
		result.append(arr3[i % b])
	print(''.join(result))


for _ in range(0, int(input())):
	(n, a, b) = map(int, input().split())
	s = ''
	ans = ''
	for i in range(0, b):
		s += chr(i + ord('a'))
	ans += s * (a // b)
	ans += s[0:a % b]
	for i in range(a, n):
		ans += ans[i - a]
	print(ans)


t = int(input())
alpha = 'abcdefghijklmnopqrstuvwxyz'
while t > 0:
	(n, a, b) = map(int, input().split())
	sub = alpha[:b]
	st = ''
	quo = n // b
	rem = n % b
	st = quo * sub
	st += sub[0:rem]
	print(st)
	t -= 1


t = int(input())
for i in range(t):
	(n, a, b) = map(int, input().split())
	s = ''
	ret = ''
	lt = 0
	dst = 0
	for _ in range(a):
		if dst == b:
			s += chr(lt + 97)
		else:
			lt += 1
			lt = lt % 26
			s += chr(lt + 97)
			dst += 1
	ret = s
	for i in range(n - a):
		if len(ret) == 1:
			lt += 1
			lt = lt % 26
			ret += chr(lt + 97)
		elif i == len(ret) - 1 or ret[i] != ret[i + 1]:
			lt += 1
			lt = lt % 26
			ret += chr(lt + 97)
		else:
			ret += chr(lt + 97)
	print(ret)


for _ in range(int(input())):
	s = 'abcdefghijklmnopqrstuvwxyz'
	(n, a, b) = map(int, input().split())
	temp1 = s[:b]
	temp2 = temp1[::-1]
	res = ''
	flag = True
	for i in range(0, a, b):
		if flag:
			res += temp1
			flag = False
		else:
			res += temp2
			flag = True
	res = res[:a]
	ans = ''
	i = 0
	while i < n:
		i += a
		ans += res
	print(ans[:n])


x = int(input())
for _ in range(x):
	inp = input().split()
	a = int(inp[0])
	b = int(inp[1])
	c = int(inp[2])
	awl = 97
	s = ''
	for i in range(a):
		s += chr(awl + i % c)
	print(s)


from string import ascii_lowercase
from sys import stdin, stdout
lowercase = ascii_lowercase
t = int(stdin.readline().strip())
input = [list(map(int, line.split())) for line in stdin.readlines()]
output = []
for string in input:
	(n, a, b) = string
	if b == 1:
		if a == 1:
			for i in range(n // 2):
				output.append('ab')
			output.append('a' * (n % 2) + '\n')
		else:
			for i in range(n):
				output.append('a')
			output.append('\n')
	else:
		diff = a - b
		pattern = ''
		for i in range(b):
			pattern += lowercase[i]
		for i in range(diff):
			pattern += 'a'
		for i in range(n):
			output.append(pattern[i % a])
		output.append('\n')
stdout.writelines(output)


t = int(input())
for _ in range(t):
	(n, a, b) = map(int, input().split())
	alph = [chr(ord('a') + i) for i in range(b)]
	out = []
	for i in range(n):
		out.append(alph[i % b])
	print(''.join(out))


import string
letters = string.ascii_lowercase

def valid(s, letter):
	return letter not in s

def fillstring(s, a, b):
	choose = letters[:b]
	unique = len(set(s))
	index = 0
	while len(s) < a:
		if unique == b:
			s += s[0]
		elif unique < b:
			while True:
				l = choose[index]
				if valid(s, l):
					s += l
					unique += 1
					break
				index += 1
				if index == len(choose):
					index = 0
	return s

def makestring(n, a, b):
	s = fillstring('', a, b)
	for i in range(n - a):
		s = s[:i + 1] + fillstring(s[i + 1:], a, b)
	return s
t = int(input())
for i in range(t):
	(n, a, b) = map(int, input().split())
	print(makestring(n, a, b))


for _ in range(int(input())):
	(n, l, m) = list(map(int, input().split()))
	st = 'abcdefghijklmnopqrstuvwxyz'
	str1 = st[:m] * int(n / m) + st[:n % m]
	print(str1)


x = 'azertyuiopqsdfghjklmwxcvbn'
for _ in range(int(input())):
	(n, a, b) = map(int, input().split())
	ans = x[0:b] * (n // b)
	ans += x[0:n % b]
	print(ans)


t = int(input())
alph = 'qwertyuioplkjhgfdsazxcvbnm'
for _ in range(t):
	(n, a, b) = list(map(int, input().split()))
	if a == b:
		o = ''
		j = 0
		for _ in range(n):
			if j == 26:
				j = 0
			o += alph[j]
			j += 1
		print(o)
	else:
		o = ''
		j = 0
		for i in range(b):
			o += alph[j]
			j += 1
		q = n // b
		d = n % b
		o = o * q
		o += o[:d]
		print(o)


x = 'abcdefghijklmnopqrstuvwxyz'
for _ in range(int(input())):
	(n, a, b) = map(int, input().split())
	repeater = x[:b]
	if a > b:
		repeater = repeater + repeater[-1] * (a - b)
	ans = ''
	rep = n // a
	req = n % a
	ans += repeater * rep + repeater[:req]
	print(ans)


t = int(input())
for i in range(t):
	(n, a, b) = map(int, input().split())
	k = []
	for i in range(97, 123):
		k.append(chr(i))
	final = ''
	p = 0
	while 1:
		if p <= b - 2:
			final = final + k[p]
			p = p + 1
		else:
			final = final + k[p] * (a - len(final))
			break
	o = n // len(final)
	print(final * o + final[0:n % a])


t = int(input())
for _ in range(t):
	(n, a, b) = map(int, input().split())
	s = 'abcdefghijklmnopqrstuvwxyz'
	s1 = s[:b] * (n // b + 1)
	s2 = s1[:n]
	print(s2)


t = int(input())
while t > 0:
	t -= 1
	(n, a, b) = map(int, input().split())
	kol = 0
	s = ''
	mp = {}
	for i in range(26):
		x = chr(i + 97)
		mp[x] = 0
	for i in range(1, n + 1):
		if i <= a:
			if kol != b:
				s += chr(kol + 97)
				mp[chr(kol + 97)] += 1
				kol += 1
			else:
				s += 'a'
				mp['a'] += 1
		else:
			j = i - a - 1
			s += s[j]
	print(s)


abc = 'abcdefghijklmnopqrstuvwxyz'
t = int(input())
for _ in range(t):
	(n, a, b) = map(int, input().split())
	subline = 'a' * (a - b) + abc[:b]
	print((subline * (n // a + 1))[:n])


t = int(input())
for _ in range(t):
	(n, a, b) = map(int, input().split())
	ls = []
	for i in range(b):
		ls.append(chr(i + 97))
	ans = ''
	count = n // b
	rem = n % b
	for i in range(count):
		ans += ''.join(map(str, ls))
	for i in range(rem):
		ans += ls[i]
	print(ans)


T = int(input())
alp = [chr(i) for i in range(97, 123)]
for i in range(T):
	(n, a, b) = map(int, input().split())
	S = ''
	for i in range(n):
		S += alp[i % b]
	print(S)


from sys import stdin
inp = stdin.readline
t = int(inp().strip())
for x in range(t):
	(n, a, b) = [int(x) for x in inp().strip().split()]
	alphabet = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
	ans1 = []
	for i in range(b):
		ans1.append(alphabet[i])
	for i in range(a - b):
		ans1.append(ans1[b - 1])
	ans2 = []
	for i in range(n):
		ans2.append(ans1[i % a])
	print(''.join(ans2))


import sys
import collections
import threading
import string

def main():
	testn = int(input())
	for _ in range(testn):
		(n, _, b) = map(int, input().split())
		s = string.ascii_lowercase[:b] * (1 + n // b)
		print(s[:n])
input = sys.stdin.readline
main()


from sys import stdin
t = int(stdin.readline())
alp = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
for _ in range(t):
	(n, a, b) = (int(x) for x in stdin.readline().split())
	s = ''
	for i in range(n):
		s += alp[i % b]
	print(s)


alfabet = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
tc = int(input())
for _ in range(tc):
	(n, a, b) = map(int, input().split())
	sub_string = ''
	string = ''
	for i in range(b):
		sub_string += alfabet[i]
	while len(string) < n:
		string += sub_string
	print(string[0:n])


t = int(input())
for tt in range(t):
	(n, a, b) = map(int, input().split())
	s = ''
	k = 97
	for i in range(b):
		s += chr(k)
		k += 1
	k = 97
	jj = s
	o = 0
	for i in range(a - b):
		jj += s[o]
		if o == len(s) - 1:
			o = 0
		else:
			o += 1
	ans = ''
	s = jj
	for i in range(n // a):
		ans += s
	if n // a * a == n:
		print(ans)
	else:
		print(ans + s[:n - n // a * a])


from math import factorial
from math import log, ceil
from collections import defaultdict
from math import *
from sys import stdin, stdout
import itertools
import os
import sys
import threading
from collections import deque, Counter, OrderedDict, defaultdict
from heapq import *
from fractions import Fraction
mod = 998244353

def ii():
	return int(input())

def si():
	return str(input())

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

def li():
	return list(mi())

def fii():
	return int(stdin.readline())

def fsi():
	return str(stdin.readline())

def fmi():
	return map(int, stdin.readline().split())

def fli():
	return list(fmi())
abd = {'a': 0, 'b': 1, 'c': 2, 'd': 3, 'e': 4, 'f': 5, 'g': 6, 'h': 7, 'i': 8, 'j': 9, 'k': 10, 'l': 11, 'm': 12, 'n': 13, 'o': 14, 'p': 15, 'q': 16, 'r': 17, 's': 18, 't': 19, 'u': 20, 'v': 21, 'w': 22, 'x': 23, 'y': 24, 'z': 25}

def getKey(item):
	return item[0]

def sort2(l):
	return sorted(l, key=getKey)

def d2(n, m, num):
	return [[num for x in range(m)] for y in range(n)]

def isPowerOfTwo(x):
	return x and (not x & x - 1)

def decimalToBinary(n):
	return bin(n).replace('0b', '')

def ntl(n):
	return [int(i) for i in str(n)]

def powerMod(x, y, p):
	res = 1
	x %= p
	while y > 0:
		if y & 1:
			res = res * x % p
		y = y >> 1
		x = x * x % p
	return res
graph = defaultdict(list)
visited = [0] * 1000000
col = [-1] * 1000000

def bfs(d, v):
	q = []
	q.append(v)
	visited[v] = 1
	while len(q) != 0:
		x = q[0]
		q.pop(0)
		for i in d[x]:
			if visited[i] != 1:
				visited[i] = 1
				q.append(i)
		print(x)

def make_graph(e):
	d = {}
	for i in range(e):
		(x, y) = mi()
		if x not in d:
			d[x] = [y]
		else:
			d[x].append(y)
		if y not in d:
			d[y] = [x]
		else:
			d[y].append(x)
	return d

def gr2(n):
	d = defaultdict(list)
	for i in range(n):
		(x, y) = mi()
		d[x].append(y)
	return d

def connected_components(graph):
	seen = set()

	def dfs(v):
		vs = set([v])
		component = []
		while vs:
			v = vs.pop()
			seen.add(v)
			vs |= set(graph[v]) - seen
			component.append(v)
		return component
	ans = []
	for v in graph:
		if v not in seen:
			d = dfs(v)
			ans.append(d)
	return ans

def primeFactors(n):
	s = set()
	while n % 2 == 0:
		s.add(2)
		n = n // 2
	for i in range(3, int(sqrt(n)) + 1, 2):
		while n % i == 0:
			s.add(i)
			n = n // i
	if n > 2:
		s.add(n)
	return s

def find_all(a_str, sub):
	start = 0
	while True:
		start = a_str.find(sub, start)
		if start == -1:
			return
		yield start
		start += len(sub)

def SieveOfEratosthenes(n, isPrime):
	isPrime[0] = isPrime[1] = False
	for i in range(2, n):
		isPrime[i] = True
	p = 2
	while p * p <= n:
		if isPrime[p] == True:
			i = p * p
			while i <= n:
				isPrime[i] = False
				i += p
		p += 1
	return isPrime

def dijkstra(edges, f, t):
	g = defaultdict(list)
	for (l, r, c) in edges:
		g[l].append((c, r))
	(q, seen, mins) = ([(0, f, ())], set(), {f: 0})
	while q:
		(cost, v1, path) = heappop(q)
		if v1 not in seen:
			seen.add(v1)
			path = (v1, path)
			if v1 == t:
				return (cost, path)
			for (c, v2) in g.get(v1, ()):
				if v2 in seen:
					continue
				prev = mins.get(v2, None)
				next = cost + c
				if prev is None or next < prev:
					mins[v2] = next
					heappush(q, (next, v2, path))
	return float('inf')

def binsearch(a, l, r, x):
	while l <= r:
		mid = l + (r - 1) // 2
		if a[mid]:
			return mid
		elif a[mid] > x:
			l = mid - 1
		else:
			r = mid + 1
	return -1

def find_all_paths(graph, start, end, path=[]):
	path = path + [start]
	if start == end:
		return path
	paths = []
	for node in graph[start]:
		if node not in path:
			newpaths = find_all_paths(graph, node, end, path)
			for newpath in newpaths:
				paths.append(newpath)
	return paths
for _ in range(ii()):
	(n, a, b) = mi()
	s = 'qwertyuiopasdfghjklzxcvbnm'
	t = ''
	t += s[:b] * (n // b)
	t += s[:n % b]
	print(t)


def solve():
	(n, a, b) = [int(x) for x in input().split(' ')]
	substr = ''
	if b != 1:
		for i in range(a):
			substr += chr(97 + i % b)
		for j in range(n):
			if j == n - 1:
				print(substr[j % a])
			else:
				print(substr[j % a], end='')
	else:
		for j in range(n):
			if j == n - 1:
				print('a')
			else:
				print('a', end='')
t = int(input())
for i in range(t):
	solve()


for _ in [0] * int(input()):
	(n, a, b) = map(int, input().split())
	print(('abcdefghijklmnopqrstuvwxyz'[:b] * n)[:n])


for _ in range(int(input())):
	(n, a, b) = [int(i) for i in input().split()]
	nn = 97
	s = ''
	for i in range(0, n):
		if nn < 97 + b:
			s = s + chr(nn)
		else:
			nn = 97
			s = s + chr(nn)
		nn += 1
	ns = len(s)
	na = n // ns
	s = s * na
	r = n % ns
	s = s + s[0:r]
	print(s)


t = int(input())
while t:
	t += -1
	(n, a, b) = map(int, input().split())
	s = ''
	tmp = 97
	for i in range(b):
		s += chr(tmp)
		tmp -= -1
	s += 'a' * (a - b)
	t2 = n // a
	ans = s * t2
	n = n - t2 * a
	print(ans, s[:n], sep='')


t = int(input())
i = 0
while i < t:
	(n, a, b) = map(int, input().split())
	s = 'abcdefghijklmnopqrstuvwxyz'
	l = []
	for x in range(b):
		l.append(s[x])
	for x in range(a - b):
		l.append(l[-1])
	for x in range(n - a):
		l.append(l[x])
	print(''.join(l))
	i = i + 1


from collections import deque
import math
for i in range(int(input())):
	(n, a, b) = map(int, input().split())
	str1 = [' '] * (n + 1)
	nChar = 96
	pointA = 1
	pointB = 0
	for i in range(1, n + 1):
		if pointA > a:
			pointA = 1
			nChar = 96
			pointB = 0
		if pointB < b:
			nChar += 1
			pointB += 1
		str1[i] = chr(nChar)
		pointA += 1
	for i in range(1, n + 1):
		print(str1[i], end='')
	print()


def main():
	for t in range(int(input())):
		(n, a, b) = [int(j) for j in input().split()]
		s = 'abcdefghijklmnopqrstuvwxyz'
		sam = s[:b] * (a // b) + s[:a % b]
		ans = sam * (n // a) + sam[:n % a]
		print(ans)
main()


t = int(input())
while t > 0:
	(n, b, a) = map(int, input().split())
	arr = []
	for i in range(a):
		arr.append(chr(ord('a') + i))
	for i in range(b - a):
		arr.append(arr[-1])
	s = ''.join(arr)
	s = s * (n // b + 1)
	print(s[:n])
	t -= 1


LETTERS = 'abcdefghijklmnopqrstuvwxyz'

def solve(n, a, b):
	result = LETTERS[:b] * (n // b + 2)
	return result[:n]

def main():
	t = int(input())
	for _ in range(t):
		(n, a, b) = map(int, input().split())
		result = solve(n, a, b)
		print(result)
	return 0
main()


from string import ascii_lowercase
t = int(input())
for i in range(t):
	(n, a, b) = map(int, input().split())
	s = ascii_lowercase[:b]
	k = (n + a - 1) // a
	s = s * n
	s = s[:n]
	print(s)


for _ in range(int(input())):
	(n, a, b) = map(int, input().split())
	list1 = []
	for i in range(a - b + 1):
		list1.append('a')
	for i in range(b - 1):
		list1.append(chr(ord('a') + i + 1))
	for i in range(n):
		print(list1[i % len(list1)], end='')
	print()


t = int(input())
for i in range(t):
	(n, a, b) = map(int, input().split())
	x = ''
	if b == 1:
		for j in range(n):
			x = x + 'a'
	else:
		count = 0
		for j in range(0, n, b):
			for k in range(b):
				x = x + chr(97 + k)
				count += 1
				if count == n:
					break
	print(x)


test = int(input())
while test:
	test -= 1
	(n, a, b) = map(int, input().split())
	ans = ''
	for i in range(b):
		ans += chr(i + 97)
	k = ans
	ans = ans * int(n / b)
	ans += k[:n % b]
	print(ans)


for i in range(int(input())):
	(n, a, b) = map(int, input().split())
	s = ''
	c = 96
	bc = 0
	for i in range(a):
		if bc < b:
			bc += 1
			c += 1
		s += chr(c)
	print((s * (n // a + 1))[:n])


test_cases = int(input())
for test_case in range(test_cases):
	(n, a, b) = map(int, input().split())
	temp = ''
	for i in range(b):
		temp += chr(97 + i)
	str_a = temp * (a // b)
	str_a += temp[:a % b]
	ans = str_a * (n // a)
	ans += str_a[:n % a]
	print(ans)


def solve():
	(n, a, b) = map(int, input().strip().split())
	distinct = ''
	for i in range(b):
		distinct += chr(ord('a') + i)
	times_b = a // b + 1
	substr = (distinct * times_b)[:a]
	times_substr = n // a + 1
	ans = (substr * times_substr)[:n]
	print(ans)
t = int(input().strip())
for _ in range(t):
	solve()


import string

def main():
	for _ in range(int(input())):
		(n, a, b) = list(map(int, input().split()))
		x = list(string.ascii_lowercase)
		x1 = x[:b]
		l = []
		i = b
		while i < n:
			l.extend(x1)
			i += b
		l.extend(x1[:n - (i - b)])
		print(''.join(l))
main()


for s in [*open(0)][1:]:
	(n, a, b) = map(int, s.split())
	print(''.join((chr(97 + i % b) for i in range(n))))


import string
t = int(input())
while t > 0:
	t = t - 1
	(n, a, b) = map(int, input().split())
	res = ''
	res += str(string.ascii_lowercase[:b])
	res = res * (n // b)
	res += str(string.ascii_lowercase[:n % b])
	print(res)


from string import ascii_lowercase as letters
t = int(input())
for i in range(t):
	(n, a, b) = input().split()
	(n, a, b) = (int(n), int(a), int(b))
	ans = [letters[i] for i in range(b)] * (n // b) + [letters[i] for i in range(n % b)]
	print(''.join(ans))


n = int(input())
for i in range(n):
	(l, a, b) = map(int, input().split())
	s = 'abcdefghijklmnopqrstuvwxyz'
	c = ''
	for j in range(b):
		c = c + s[j]
	d = c[::-1]
	v = ''
	for j in range(0, l, len(c)):
		v = v + c
	for j in range(0, l % b):
		v = v + c
	print(v[0:l])


res = []
s = 'abcdefghijklmnopqrstuvwxyz'
t = int(input())
for i in range(t):
	(n, a, b) = [int(x) for x in input().split()]
	res.append((n, a, b, s[:b]))
for (n, a, b, s) in res:
	q = divmod(n, b)
	print(s * q[0] + s[:q[1]])


alphabet = 'abcdefghijklmnopqrstuvwxyz'
t = int(input())
for _ in range(t):
	(n, a, b) = [int(i) for i in input().split()]
	al = alphabet[:b]
	print(al * (n // len(al)) + al[:n % len(al)])


for i in range(int(input())):
	(n, a, b) = list(map(int, input().split()))
	x = ''
	v = 97
	for i in range(b):
		x += chr(v)
		v += 1
	x += chr(v - 1) * (a - b)
	for i in range(n):
		print(x[i % a], end='')
	print('')


t = int(input())
for _ in range(t):
	(n, a, b) = map(int, input().split())
	res = ''
	if a == 1 and b == 1:
		for i in range(n):
			res += chr(ord('a') + i % b)
	else:
		s = ''
		for i in range(b):
			s += chr(ord('a') + i)
		l = 0
		while l < n:
			if l + len(s) > n:
				res += s[:n - l]
				break
			res += s
			l += len(s)
	print(res)


tests = int(input())
while tests > 0:
	(length, subLength, distinctLetters) = [int(i) for i in input().split(' ')]
	string = []
	letter = 97
	i = 0
	while i < distinctLetters:
		string.append(chr(letter + i))
		i += 1
	string = string * (length // distinctLetters + 1)
	print(''.join(string[:length]))
	tests = tests - 1


t = int(input())
while t != 0:
	(n, a, b) = map(int, input().split())
	net = [i for i in range(b)]
	temp = []
	for i in range(n):
		temp.append(net[i % b])
	ans = []
	for i in temp:
		ans.append(chr(i + 97))
	print(''.join(ans))
	t -= 1


t = int(input())
for _ in range(t):
	(n, a, b) = list(map(int, input().split()))
	s = 'qwertyuiopasdfghjklzxcvbnm'
	S = s[:b]
	res = ''
	for i in range(n):
		res += S[i % b]
	print(res)


t = int(input())
for i in range(t):
	(n, a, b) = map(int, input().split())
	alphabet = 'abcdefghijklmnopqrstuvwxyz'
	sv = alphabet[0:b]
	sv = sv * n
	print(sv[0:n])


for i in range(0, int(input())):
	(n, a, b) = list(map(int, input().split()))
	p = 97
	q = ''
	qq = ''
	z = 0
	while len(qq) < n:
		for i in range(97, 97 + b):
			q = q + chr(i)
		while len(q) < a:
			q = q + chr(i)
		qq = qq + q
	print(qq[0:n])


t = int(input())
char_set = [97 + i for i in range(26)]
while t:
	x = list(map(int, input().split()))
	(n, a, b) = (x[0], x[1], x[2])
	s = ''
	for i in range(b):
		s += chr(char_set[i])
	for i in range(b, a):
		s += chr(char_set[b - 1])
	k = s
	i = a
	while i < n:
		first = min(n - i, a)
		s += k[0:first]
		i += a
	print(s)
	t -= 1


t = int(input())
for _ in range(t):
	(n, a, b) = tuple(map(int, input().split(' ')))
	x = [0] * n
	start = 0
	for c in range(a):
		x[start + c] = chr(ord('a') + c % b)
	for c in range(a, n):
		x[c] = x[c % a]
	print(''.join(map(str, x)))


n = int(input())
for i in range(n):
	(a, b, c) = map(int, input().split())
	p = 'a'
	for j in range(1, a):
		p += chr(j % c + 97)
	print(p)


t = int(input())
letters = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
for i in range(0, t):
	(n, a, b) = list(map(int, input().split()))
	left = ''
	for j in range(0, b):
		left += letters[j]
	middle = letters[b - 1] * (a - b)
	right = ''
	for k in range(0, n - a):
		right += left[k % b]
	print(left + middle + right)


from collections import Counter
t = int(input())
for wer in range(t):
	(n, a, b) = map(int, input().split())
	char = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
	lenb = ''
	lenb += char[0] * (a - (b - 1))
	x = a - (b - 1)
	num = a - x
	for i in range(1, num + 1):
		lenb += char[i]
	n1 = n // a
	n2 = n % a
	st = n1 * lenb + ''.join(list(lenb)[:n2])
	print(st)


def construct(n, a, b):
	ans = ''
	i = 97
	while len(ans) != b:
		ans += chr(i)
		i += 1
	fin = ''
	k = 0
	while len(fin) != n:
		fin += ans[k]
		if k == len(ans) - 1:
			k = 0
		else:
			k += 1
	return fin
t = int(input())
for i in range(t):
	x = list(map(int, input().rstrip().split()))
	print(construct(x[0], x[1], x[2]))


t = int(input())
for q in range(t):
	(n, a, b) = map(int, input().split())
	l = ''
	s = ''
	for j in range(b):
		l = l + chr(j + 97)
	for i in range(n):
		s = s + l
		if len(s) >= n:
			break
	print(s[:n])


for _ in range(int(input())):
	(n, a, b) = map(int, input().split())
	mas = [i for i in range(b)] + [b - 1 for i in range(a - b)]
	s = []
	for i in range(n):
		s.append(chr(mas[i % a] + 97))
	print(''.join(s))


for case in range(int(input())):
	v = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
	(n, a, b) = map(int, input().split())
	s = ''
	temp = ''
	for i in range(b):
		s = s + v[i]
	while n - len(temp) >= b:
		temp += s
	temp += s[0:n - len(temp)]
	print(temp)


t = int(input())
for i in range(t):
	(n, a, b) = input().split()
	alpha = list('abcdefghijklmnopqrstuvwxyz')
	letters = alpha[:int(b)]
	ans = ''
	j = 0
	for k in range(int(n)):
		ans = ans + letters[j]
		j += 1
		if j == int(b):
			j = 0
	print(ans)


import math
t = int(input())
for i in range(t):
	s = input().split(' ')
	a = int(s[0])
	b = int(s[1])
	c = int(s[2])
	s = ''
	for ii in range(c):
		ch = chr(ord('a') + ii)
		s += ch
	ss = int(b / c) * s + s[0:b % c]
	ans = int(a / b) * ss + ss[0:a % b]
	print(ans)


import string
T = int(input())
for t in range(T):
	(n, a, b) = [int(i) for i in input().split(' ')]
	s = ''
	sub = 'a' * (a - b)
	for i in range(b):
		sub += string.ascii_lowercase[i]
	for i in range(n):
		s += sub[i % len(sub)]
	print(s)


import os
import sys
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))
input = lambda : sys.stdin.readline().rstrip('\r\n')
for _ in range(int(input())):
	(n, a, b) = map(int, input().split())
	next = 'abcdefghijklmnopqrstuvwxyz'[:b] * (n // b + 1)
	print(next[:n])


import re
import sys
from bisect import bisect, bisect_left, insort, insort_left
from collections import Counter, defaultdict, deque
from copy import deepcopy
from decimal import Decimal
from itertools import accumulate, combinations, combinations_with_replacement, groupby, permutations, product
from math import acos, asin, atan, ceil, cos, degrees, factorial, gcd, hypot, log2, pi, radians, sin, sqrt, tan
from operator import itemgetter, mul
from string import ascii_lowercase, ascii_uppercase, digits

def inp():
	return int(input())

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

def instr():
	s = input()
	return list(s[:len(s)])

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

def def_value():
	return False
t = inp()
for _ in range(t):
	(n, a, b) = invr()
	sb = ''
	for i in range(b):
		sb += chr(ord('a') + i)
	for i in range(a - b):
		sb += chr(ord('a') + (b - 1))
	res = sb * (n // a + 1)
	print(res[:n])


for i in [*open(0)][1:]:
	(a, b, c) = map(int, i.split())
	print(('abcdefghijklmnopqrstuvwxyz'[:c] * 2001)[:a])


t = int(input())
words = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
for i in range(t):
	(n, a, b) = map(int, input().split())
	ans = []
	if b > 26:
		b = 26
	for k in range(int(n / b) + 1):
		for l in range(b):
			ans.append(words[l])
	for k in range(n):
		print(ans[k], end='')
	print()


for _ in range(int(input())):
	(n, a, b) = map(int, input().split())
	ch = 'a'
	if a == n and b == 1:
		for i in range(n):
			print('a', end='')
	elif a == n and b == n:
		for i in range(n):
			print(chr(ord(ch) + i), end='')
	else:
		list1 = []
		for i in range(b):
			list1.append(chr(ord(ch) + i))
		for j in range(b, n):
			list1.append(list1[j - b])
		for j in range(n):
			print(list1[j], end='')
	print()


def cts(n, a, b):
	s = 'abcdefghijklmnopqrstuvwxyz'
	s = s[:b]
	while len(s) < n:
		s += s
	return s[:n]
ts = int(input())
for t in range(ts):
	(n, a, b) = list(map(int, input().split()))
	res = cts(n, a, b)
	print(res)


T = int(input())
for t in range(T):
	(n, a, b) = map(int, input().split())
	stri = 'bcdefghijklmnopqrstuvwxyz'
	pos = 0
	ans = ''
	i = 0
	while i < n:
		k = 0
		while k < b - 1 and i < n:
			ans += stri[pos]
			k += 1
			i += 1
			pos += 1
		while k < a and i < n:
			ans += 'a'
			i += 1
			k += 1
		pos = 0
	print(ans)


import sys
input = sys.stdin.readline
for _ in range(int(input())):
	(n, a, b) = list(map(int, input().split()))
	alpha = 'abcdefghijklmnopqrstuvwxyz'
	(times, rem) = divmod(n, b)
	res = alpha[:b] * times
	res += alpha[:rem]
	print(res)


t = int(input())
for _ in range(t):
	(n, a, b) = map(int, input().split())
	ans = ''
	cnt = 0
	for i in range(b - 1):
		ans += chr(cnt + 97)
		cnt += 1
		cnt %= 26
	if a >= b:
		ans += chr(cnt + 97) * (a - b + 1)
	for i in range(n - a):
		if a == 1:
			cnt += 1
			cnt %= 26
			ans += chr(cnt + 97)
		elif len(set(ans[-(a - 1):])) == b:
			ans += chr(cnt + 97)
		else:
			cnt += 1
			cnt %= 26
			ans += chr(cnt + 97)
	print(ans)


import math
t = int(input())
while t:
	(n, a, b) = list(map(int, input().split()))
	s = ''
	for i in range(97, 97 + b):
		s = s + chr(i)
	p = s[0]
	for i in range(a - b):
		s = s + p
	f = ''
	for i in range(n):
		f = f + s[i % len(s)]
	print(f)
	t = t - 1


for _ in range(int(input())):
	(n, a, b) = map(int, input().split())
	s = 'abcdefghijklmnopqrstuvwxyz'
	res = s[0:b]
	(i, j) = (b, 0)
	while i < a:
		res += res[j]
		i += 1
		j += 1
		if j == b:
			j = 0
	(i, j) = (a, 0)
	while i < n:
		res += res[j]
		i += 1
		j += 1
		if j == a:
			j = 0
	print(res)


from string import *
for i in range(int(input())):
	(n, a, b) = map(int, input().split())
	s = ascii_letters
	s = s[:b]
	s1 = s * (n // b) + s[:n % b]
	print(s1)


t = int(input())
for _ in range(t):
	(n, a, b) = map(int, input().split(' '))
	str1 = ''
	for i in range(b):
		str1 = str1 + chr(i + 97)
	final = ''
	for i in range(n // b):
		final = final + str1
	for i in range(n % b):
		final = final + chr(i + 97)
	print(final)


for _ in range(int(input())):
	(n, a, b) = map(int, input().split())
	aa = ''
	for i in range(n):
		c = i % b
		aa += chr(97 + c)
	print(aa)


t = int(input())
for i in range(t):
	(n, a, b) = map(int, input().split())
	for j in range(n):
		c = chr(ord('a') + j % b)
		print(c, end='')
	print()


li = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
for _ in range(int(input())):
	(n, a, b) = map(int, input().split())
	act = li[:b] + [li[b - 1]] * (a - b)
	i = a
	while i != n:
		act = act + act[:min(a, n - i)]
		i += min(a, n - i)
	print(''.join(act))


t = int(input(''))
c = []
for i in range(97, 123, 1):
	c.append(chr(i))
for _ in range(t):
	(n, a, b) = list(map(int, input('').split(' ')))
	s = ''
	for i in range(n):
		s = s + c[i % b]
	print(s)


cases = int(input())
letters = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
for case in range(cases):
	values = input().split()
	(length, substring, distinct) = (int(values[0]), int(values[1]), int(values[2]))
	item = ''
	result = ''
	for i in range(distinct):
		item += letters[i]
	times = substring // distinct
	remainder = substring % distinct
	item = item * times + item[:remainder]
	times_total = length // substring
	remainder_total = length % substring
	result += item * times_total
	result += item[:remainder_total]
	print(result)


def main():
	d = int(input())
	for i in range(d):
		(n, a, b) = [int(v) for v in input().split()]
		s = ''
		for i in range(a):
			s += chr(ord('a') + i % b)
		ss = s * (n // a + 1)
		ss = ss[0:n]
		print(ss)
main()


for xyz in range(0, int(input())):
	(n, a, b) = map(int, input().split())
	ssb = ''
	for i in range(0, b):
		ssb += chr(97 + i)
	ssa = ssb * (a // b)
	ssa += ssb[0:a % b]
	s = ssa * (n // a)
	s += ssa[0:n % a]
	print(s)


for _ in range(int(input())):
	(n, a, b) = map(int, input().split())
	print(*[chr(ord('a') + i % b) for i in range(n)], sep='')


import random
t = int(input())
for _ in range(t):
	(n, a, b) = list(map(int, input().split()))
	alphabets = 'qwertyuiopasdfghjklzxcvbnm'
	chars = alphabets[:b]
	rem = n % b
	quo = n // b
	print(chars * quo + chars[:rem])


for _ in range(int(input())):
	(n, a, b) = [int(x) for x in input().split()]
	st = ''
	p = 0
	for i in range(n):
		st += chr(p % b + 97)
		p += 1
	print(st)


import string
li = list(string.ascii_lowercase)
t = int(input())
for _ in range(t):
	(n, a, b) = map(int, input().split())
	lis = li[:b]
	c = 0
	for i in range(n):
		if c == len(lis):
			c = 0
		print(lis[c], end='')
		c = c + 1
	print('')


t = int(input())
for _ in range(t):
	(n, a, b) = map(int, input().split())
	ret = []
	tmp = []
	f = [chr(i) for i in range(97, 123)]
	for i in range(n):
		if i < b:
			ret.append(f.pop())
		else:
			ret.append(ret[i - b])
	print(''.join(ret))


from sys import stdin, stdout
import math, sys
from itertools import permutations, combinations
from collections import defaultdict, deque, OrderedDict
import bisect as bi

def I():
	return int(input())

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

def find_gt(a, x):
	i = bi.bisect_right(a, x)
	if i != len(a):
		return i
	else:
		return -1

def main():
	try:
		l = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
		for i in range(I()):
			(n, a, b) = In()
			temp = []
			for i in range(b):
				temp.append(l[i])
			ans = temp * (n // b + 1)
			for i in range(n):
				print(ans[i], end='')
			print()
	except:
		pass
M = 998244353
P = 1000000007
main()


for i in range(int(input())):
	(n, a, b) = map(int, input().split())
	string = ''
	for j in range(b):
		string += chr(97 + j)
	string += chr(97 + b - 1) * (a - b)
	index = 0
	while n > 0:
		print(string[index], end='')
		index += 1
		if index == a:
			index = 0
		n -= 1
	print()


t = int(input())
letters = 'abcdefghijklmnopqrstuvwxyz'
for _ in range(t):
	(n, a, b) = map(int, input().split())
	needed_letters = letters[:b]
	l = n // b
	print(needed_letters * l + needed_letters[:n - l * b])


def solve(n, a, b):
	ans = ''
	for i in range(n):
		ch = chr(i % b + ord('a'))
		ans += ch
	return ans
t = int(input())
for _ in range(t):
	(n, a, b) = map(int, input().split())
	ans = solve(n, a, b)
	print(ans)


from sys import stdin
from sys import stdout
sprint = stdout.write
sinput = stdin.readline

def func():
	[n, a, b] = [int(x) for x in input().split()]
	[j, k, c] = [0, 0, 0]
	r = a // b
	for i in range(n):
		print(chr(97 + j), end='')
		if k == r - 1:
			k = 0
			j += 1
		else:
			k += 1
		if j == b:
			j = 0
	print()
t = int(sinput())
while t != 0:
	t -= 1
	func()


for _ in range(int(input())):
	(n, a, b) = map(int, input().split(' '))
	s = ''
	temp = 97
	for i in range(b):
		s = s + chr(97 + i)
	temp = int(n / b)
	temp1 = s
	s = s * temp
	for i in range(n - b * temp):
		s = s + chr(97 + i)
	print(s)


def solve(n, a, b):
	letters = [chr(i + 97) for i in range(b)]
	ans = ''
	for i in range(n):
		ans += letters[i % b]
	return ans

def main():
	t = int(input())
	i = 1
	while i <= t:
		(n, a, b) = map(int, input().split())
		ans = solve(n, a, b)
		print(ans)
		i += 1
main()


import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 6)

def in_int():
	return int(input())

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

def in_str():
	s = input()
	return list(s[:len(s) - 1])

def in_ints():
	return map(int, input().split())
t = in_int()
for tt in range(t):
	(n, a, b) = in_ints()
	b -= 1
	p = n // a
	ans = ''
	s = 'qwertyuiopasdfghjklzxcvbnm'
	if b > 0:
		for xx in range(p):
			ans += s[:b]
			ans += 'm' * (a - b)
		if p * a < n:
			xx = n - p * a
			if xx >= b:
				ans += s[:b]
				ans += 'm' * (xx - b)
			else:
				ans += s[:xx]
	else:
		ans = 'm' * n
	print(ans)


adc = 'abcdefghijklmnopqrstuvwxyz'
t = int(input())
for _ in range(t):
	(n, a, b) = map(int, input().split())
	res = []
	inda = 0
	indb = 0
	while len(res) < n:
		res.append(adc[indb])
		indb += 1
		if indb == b:
			indb = 0
	print(''.join(res))


t = int(input())
while t > 0:
	(n, a, b) = input().split(' ')
	n = int(n)
	a = int(a)
	b = int(b)
	s1 = 'abcdefghijklmnopqrstuvwxyz'
	s = s1[:b] * (n // b) + s1[:n % b]
	print(s)
	t -= 1


for _ in range(int(input())):
	(n, a, b) = map(int, input().split())
	lst = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
	yo = n % b
	yo2 = n - yo
	lst2 = lst[:b]
	st = list(''.join(lst2) * (yo2 // b))
	for i in range(yo):
		st.append(lst[i])
	print(''.join(st))


import math, sys
from sys import stdin, stdout
from collections import Counter, defaultdict, deque
input = stdin.readline
I = lambda : int(input())
li = lambda : list(map(int, input().split()))

def case():
	(n, a, b) = li()
	s = 'abcdefghijklmnopqrstuvwxyz'
	ans = []
	j = 0
	for i in range(n):
		ans.append(s[j])
		j += 1
		if j == b:
			j = 0
	print(''.join(map(str, ans)))
for _ in range(int(input())):
	case()


T = int(input())
for tc in range(T):
	(a, b, c) = map(int, input().split())
	ans = ''
	tmp = 'abcdefghijklmnopqrstuvwxyz'
	tmp = tmp[:c]
	for i in range(a):
		ans += tmp[i % c]
	print(ans)


q = int(input())
alph = 'abcdefghijklmnopqrstuvwxyz'

def to_arr(s):
	a = [0] * len(s)
	for i in range(len(s)):
		a[i] = alph.index(s[i])
	return a
for _ in range(q):
	(n, a, b) = map(int, input().split())
	d = alph[:b]
	s = ''
	while len(s) < n:
		s += d
	print(s[:n])


t = int(input())
s = 'abcdefghijklmnopqrstuvwxyz'
for i in range(t):
	(n, a, b) = map(int, input().split())
	k = s[:b] * 2000
	print(k[:n])


import random
import string
res = []
t = int(input())
for i in range(t):
	a = list(map(int, input().split()))
	s = 'abcdefghijklmnopqrstuvwxyz'
	c = 0
	r = ''
	for i in range(a[0]):
		r = r + s[c]
		c += 1
		if c == a[2]:
			c = 0
	res.append(r)
for i in res:
	print(i)


t = int(input())
for k in range(t):
	(n, a, b) = map(int, input().split())
	x = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
	count = 0
	f = True
	if a == b:
		while 1:
			for i in range(a):
				print(x[i], end='')
				count += 1
				if count == n:
					f = False
					break
			if f == False:
				break
		print()
	else:
		while 1:
			j = 0
			for i in range(j, b + j):
				print(x[i], end='')
				count += 1
				if count == n:
					f = False
					break
			if f == False:
				break
			z = a - b
			for i in range(z):
				print(x[0], end='')
				count += 1
				if count == n:
					f = False
					break
			if f == False:
				break
			j += 1
		print()


import math
t = int(input())
for i in range(t):
	(n, a, b) = map(int, input().split())
	generator = ''
	for j in range(b):
		generator += chr(ord('a') + j)
	while len(generator) < a:
		generator += generator[-1]
	builder = (generator * math.ceil(n / a))[:n]
	print(builder)


for i in range(int(input())):
	(n, a, b) = map(int, input().split())
	cnt = 0
	s = ''
	for i in range(n):
		s = s + chr(cnt % b + 1 + 96)
		cnt += 1
	print(s)


import sys
input = sys.stdin.buffer.readline
s = 'abcdefghijklmnopqrstuvwxyz'
for _ in [0] * int(input()):
	(n, a, b) = map(int, input().split())
	shablon = s[0:b]
	r1 = shablon * (n // b)
	x = n % b
	if x > 0:
		r1 += s[0:x]
	print(r1)


count = int(input())
while count > 0:
	(n, a, b) = map(int, input().split())
	result = ''
	for x in range(0, n):
		result += chr(ord('a') + x % b)
	print(result)
	count = count - 1


test = int(input())
while test:
	test -= 1
	(n, a, b) = map(int, input().split())
	ans = ''
	cc = ''
	for i in range(b):
		ans += chr(i + 97)
	cc = ans
	flag = True
	x = n % b
	for i in range(1, int(n / b)):
		if False:
			if i % 2 == 1:
				ans += cc[::-1]
				flag = True
			else:
				ans += cc
				flag = False
		else:
			ans += cc
	ans += cc[:x]
	print(ans)


t = int(input())
alph = 'abcdefghijklmnopqrstuvwxyz'
for _ in range(t):
	(n, a, b) = map(int, input().split())
	ans = [alph[i] for i in range(b)]
	while len(ans) < n:
		ans.append(ans[len(ans) - b])
	print(''.join(ans))


t = int(input())
for i in range(t):
	(n, a, b) = map(int, input().split())
	k = 0
	a = ''
	alphabet = 'abcdefghijklmnopqrstuvwxyz'
	for j in range(n):
		if k >= b:
			k = 0
		a = a + alphabet[k]
		k += 1
	print(a)


import math
t = int(input())
while t:
	t -= 1
	(n, a, b) = map(int, input().split())
	l = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
	rsb = l[:b]
	st = []
	k = 0
	for i in range(n):
		st.append(rsb[k])
		k += 1
		if k >= b:
			k = 0
	print(''.join(st))


t = int(input())
for i in range(t):
	(n, a, b) = map(int, input().split())
	s = [0] * n
	alph = 'abcdefghijklmnopqrstuvwxyz'
	if a == b:
		for j in range(n):
			s[j] = alph[j % 26]
	else:
		for j in range(n):
			s[j] = alph[j % b]
	print(''.join(s))


t = int(input())
for _ in range(t):
	(n, a, b) = [int(i) for i in input().split()]
	w = 0
	s = ''
	for i in range(b):
		s += chr(ord('a') + i)
	s += chr(ord('a') + b - 1) * (a - b)
	s *= n // a
	s += s[:n - len(s)]
	print(s)


t = int(input())
alphabets = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
for testcase in range(t):
	inp = [int(x) for x in input().split()]
	(n, a, b) = (inp[0], inp[1], inp[2])
	i = 0
	s = ''
	while i < n:
		for j in range(a - b + 1):
			s += 'a'
			i = i + 1
		for k in range(b - 1):
			s += alphabets[k + 1]
			i = i + 1
	print(s[:n])


a = int(input())
e = []
for x in range(97, 123):
	e.append(chr(x))
for x in range(a):
	k = ''
	p = 0
	(b, c, d) = map(int, input().split())
	for y in range(b):
		if p == d:
			p = 0
		k += e[p]
		p += 1
	print(k)


for i in range(int(input())):
	(a, b, c) = map(int, input().split())
	string = 'abcdefghijklmnopqrstuvwxyz'
	x = ''
	for i in range(c):
		x += string[i]
	qa = b - c
	x += x[-1] * qa
	opd = a // b
	opt = a % b
	q = x * opd
	for i in range(opt):
		q += x[i]
	print(q)


t = int(input())
for i in range(t):
	(n, a, b) = map(int, input().split())
	k = 0
	s = ''
	for j in range(a):
		if a + 1 - b > 0:
			s += 'a'
			b += 1
		else:
			k += 1
			s += chr(k + 97)
	s = s * ((n + a - 1) // a)
	print(s[:n])


sp = list('qwertyuiopasdfghjklzxcvbnm')
for i in range(int(input())):
	(a, b, c) = map(int, input().split())
	string = ''
	h = 0
	for j in range(a):
		string += sp[h]
		h += 1
		if h == c:
			h = 0
	print(string)


import sys
input = sys.stdin.readline
t = int(input())
for r in range(t):
	(n, a, b) = map(int, input().split())
	temps = ''
	for i in range(b):
		temps += chr(97 + i)
	tempans = temps * (a // b)
	tempans += temps[:a % b]
	ans = tempans * (n // a)
	ans += tempans[:n % a]
	print(ans)


t = int(input())
for test in range(t):
	(n, a, b) = [int(x) for x in input().split()]
	uniq = []
	alpha = [chr(x) for x in range(97, 123)]
	for x in range(b):
		num = alpha[x % 26]
		uniq.append(num)
	uniq = uniq * (n // b + 1)
	for j in range(n):
		if j == n - 1:
			print(uniq[j])
		else:
			print(uniq[j], end='')


k = int(input())
x = 'abcdefghijklmnopqrstuvwxyz'
for i in range(k):
	t = input().split()
	length = int(t[0])
	portion = int(t[1])
	distinct = int(t[2])
	f = distinct
	kk = x[:f]
	jk = kk * (portion // f + 1)
	if len(jk) > portion:
		tk = jk[:portion]
	else:
		tk = jk
	d = tk * (length // portion + 1)
	if len(d) == length:
		print(d)
	else:
		print(d[:length])


import string
t = int(input())
alphabet = list(string.ascii_lowercase)
for _ in range(t):
	(n, a, b) = [int(x) for x in input().split()]
	string = ''
	letters = alphabet[:b]
	for i in range(n):
		if i > b - 1:
			index = i % b
		else:
			index = i
		string += letters[index]
	print(string)


t = int(input())
for i in range(t):
	(n, a, b) = list(map(int, input().split()))
	str = ''
	cnt = 0
	for i in range(b):
		str = str + chr(ord('a') + i)
	str = str + 'a' * (a - b)
	print(n // a * str + str[0:n % a])


t = int(input())
inputs = [list(map(int, input().split())) for _ in range(t)]

def create_string(max_len, sub_s, dist):
	s = []
	x = 0
	while x <= max_len:
		for i in range(ord('a'), ord('a') + dist):
			x += 1
			if x > max_len:
				break
			else:
				s.append(chr(i))
	return s
for i in inputs:
	print(''.join(create_string(i[0], i[1], i[2])))


import sys
import math
T = int(sys.stdin.readline())
pattern = 'abcdefghijklmnopqrstuvwxyz'
for _ in range(T):
	(n, a, b) = map(int, sys.stdin.readline().split())
	substr = pattern[:b]
	times = n // b
	s = substr * times
	rest = n - times * b
	if rest > 0:
		s += pattern[:rest]
	print(s)


for t in range(int(input())):
	(n, a, b) = map(int, input().split())
	ans = ''
	for i in range(n):
		res = chr(ord('a') + i % b)
		ans += res
	print(ans)


import sys
from math import ceil
input = sys.stdin.readline
f = lambda : list(map(int, input().split()))
let = 'qwertyuiopasdfghjklzxcvbnm'
for i in range(int(input())):
	(n, a, b) = f()
	num = int(ceil(n / b))
	out = let[0:b] * num
	print(''.join(out[0:n]))


alphabet = 'abcdefghijklmnopqrstuvwxyz'
t = int(input())
while t:
	t -= 1
	a = input()
	a = a.split()
	a[0] = int(a[0])
	a[1] = int(a[1])
	a[2] = int(a[2])
	answer = ''
	counter = 0
	for i in range(0, a[0]):
		answer = answer + alphabet[counter]
		counter += 1
		counter = counter % a[2]
	print(answer)


s = 'abcdefghijklmnopqrstuvwxyz'
t = int(input())
for j in range(t):
	(n, a, b) = map(int, input().split())
	ans = ''
	for i in range(n):
		ans += s[i % b]
	print(ans)


import sys
import math
from collections import defaultdict
mod = 1000000007
T = 1
T = int(sys.stdin.readline())
for _ in range(T):
	(n, a, b) = map(int, input().split())
	s = ''
	for i in range(b):
		s += chr(i + 97)
	ans = s * (n // b)
	ans += s[:n % b]
	print(ans)


import math
t = int(input())
for i in range(t):
	tem = 'abcdefghijklmnopqrstuvwxyz'
	a = [int(x) for x in input().split()]
	n = a[0]
	b = a[2]
	a = a[1]
	s1 = tem[:b]
	s2 = 'a' * (a - b)
	s = s1 + s2
	lens = len(s)
	m = math.ceil(n / lens)
	s = s * m
	print(s[:n])


for _ in range(int(input())):
	(l, m, n) = map(int, input().split())
	sin = ''.join([chr(i + 97) for i in range(n)])
	sin += 'a' * (m - n)
	ans = sin * (l // m) + sin[:l % m]
	print(ans)


import sys
import math
mod = 998244353

def power(x, y, p):
	res = 1
	x = x % p
	if x == 0:
		return 0
	while y > 0:
		if y & 1 == 1:
			res = res * x % p
		y = y >> 1
		x = x * x % p
	return res

def modInverse(a, m):
	m0 = m
	y = 0
	x = 1
	if m == 1:
		return 0
	while a > 1:
		q = a // m
		t = m
		m = a % m
		a = t
		t = y
		y = x - q * y
		x = t
	if x < 0:
		x = x + m0
	return x
t = int(input())
for _ in range(t):
	(n, a, b) = map(int, input().split())
	d = [0] * 26
	s = ''
	i = 0
	j = 1
	for ___ in range(a):
		if j < b:
			s += chr(j + 97)
		else:
			s += 'a'
		j += 1
	i = a
	j = 0
	while i < n:
		s += s[j]
		i += 1
		j += 1
	print(s)


n = int(input())
for i in range(n):
	(num, a, b) = map(int, input().split())
	ans = ''
	for j in range(a - b):
		ans += 'a'
	for j in range(b):
		ans += chr(ord('a') + j % 26)
	for j in range(num - a):
		ans += ans[j]
	print(ans)


import math
from collections import defaultdict
for _ in range(int(input())):
	(n, a, b) = map(int, input().split())
	if n % 2 != 0:
		temp = ''
		j = 0
		for i in range(n - 1):
			temp += chr(97 + j)
			j = (j + 1) % b
		temp += chr(97 + j)
	else:
		j = 0
		temp = ''
		for i in range(n):
			temp += chr(97 + j)
			j = (j + 1) % b
	print(temp)


t = int(input())
for i in range(t):
	s = input()
	(a, b, c) = s.split()
	a = int(a)
	b = int(b)
	c = int(c)
	p = 97
	w = ''
	fw = ''
	for j in range(1, b + 1):
		w += chr(p)
		p += 1
		if j % c == 0:
			p = 97
	num = a // b + 1
	fw = w * num
	print(fw[:a])


import sys
t = int(input())
for q in range(t):
	(n, a, b) = map(int, input().split())
	alphabet = 'abcdefghijklmnopqrstuvwxyz'
	sub = alphabet[0:b]
	rtn = ''
	for i in range(n // b):
		rtn += sub
	rtn += alphabet[0:n % b]
	print(rtn)


lis = 'abcdefghijklmnopquvtrswxyz'
for i in range(int(input())):
	(n, a, b) = map(int, input().split())
	for i in range(n):
		print(lis[i % b], end='')
	print()


t = int(input())
for i in range(t):
	(n, a, b) = map(int, input().split())
	pk = [None] * n
	rep = a - b + 1
	p = 0
	k = 0
	trig = 1
	for j in range(n):
		pk[j] = chr(ord('a') + p)
		if trig:
			k += 1
			if k == rep:
				trig = 0
				k = 0
		if not trig:
			p += 1
			if p == b:
				p = 0
				trig = 1
	for j in pk:
		print(j, end='')
	print()


import math
testCases = int(input())
for _ in range(testCases):
	(n, a, b) = [int(x) for x in input().split()]
	values = 'abcdefghijklmnopqrstuvwxyz'
	answer = ''
	for index in range(n):
		answer += values[index % b]
	print(answer)


def more(n, chlist):
	string = ''
	count = 0
	i = 0
	while count < n:
		if i == len(chlist):
			i = 0
		string += chlist[i]
		count += 1
		i += 1
	return string

def translate(l):
	(n, a, b) = (l[0], l[1], l[2])
	chlist = []
	if a <= b:
		j = 0
	else:
		j = n - b
	i = 97
	while j < n and i <= 122:
		chlist.append(chr(i))
		j += 1
		i += 1
		if i == 123:
			i = 97
	if a <= b:
		string = ''
		for i in chlist:
			string += i
		return string
	else:
		return more(n, chlist)
n = int(input())
l = []
for i in range(n):
	l.append([int(j) for j in input().split()])
for i in l:
	print(translate(i))


alphabets = [chr(i) for i in range(ord('a'), ord('z') + 1)]
t = int(input())
for _ in range(t):
	(x1, y1, z1) = map(int, input().split())
	answer = ''
	for i in range(z1):
		answer = answer + alphabets[i]
	answer = answer * x1
	answer = answer[:x1]
	print(answer)


for _ in range(int(input())):
	(n, a, b) = map(int, input().split(' '))
	f = ord('a')
	uniset = ''
	for i in range(b):
		uniset = uniset + chr(f + i)
	tmp = int(n / b)
	tmp2 = int(n % b)
	res = uniset * tmp + uniset[:tmp2]
	print(res)


n = int(input())
for i in range(n):
	p = list(map(int, input().split()))
	a = 92
	for j in range(p[0]):
		if j % p[2] == 0:
			a = 97
			print(chr(a), end='')
			a += 1
		else:
			print(chr(a), end='')
			a += 1
	print()


for i in range(int(input())):
	(N, a, b) = map(int, input().split())
	em = ''
	data = [chr(97 + i) for i in range(26)]
	i = 0
	while b:
		em += data[i]
		b -= 1
		i += 1
	if len(em) < N:
		em *= N // len(em) + 1
		print(em[:N])
	else:
		print(em[:N])


import sys
from itertools import accumulate

def input():
	return sys.stdin.readline().strip()

def list2d(a, b, c):
	return [[c] * b for i in range(a)]

def list3d(a, b, c, d):
	return [[[d] * c for j in range(b)] for i in range(a)]

def list4d(a, b, c, d, e):
	return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]

def ceil(x, y=1):
	return int(-(-x // y))

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

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

def LIST(N=None):
	return list(MAP()) if N is None else [INT() for i in range(N)]

def Yes():
	print('Yes')

def No():
	print('No')

def YES():
	print('YES')

def NO():
	print('NO')
INF = 10 ** 18
MOD = 10 ** 9 + 7
for _ in range(INT()):
	(N, a, b) = MAP()
	s = ''
	for i in range(b):
		c = chr(i + 97)
		s += c
	s += 'a' * (a - b)
	M = ceil(N, a)
	ans = s * M
	ans = ans[:N]
	print(ans)


t = int(input())
s = 'abcdefghijklmnopqrstuvwxyz'
for i in range(t):
	(n, a, b) = map(int, input().split())
	res = ''
	if b > 1:
		while n > 0:
			res += s[0:b]
			n = n - b
		if n % b != 0:
			res = res[:-len(s[0:b])]
			res += s[0:(n + b) % b]
	else:
		for j in range(n):
			res += s[0]
	print(res)


t = int(input())
for _ in range(t):
	(n, a, b) = map(int, input().split())
	s = [''] * (n + 1)
	i = 1
	x = 0
	l = 0
	while i <= n:
		s[i] = chr(97 + x)
		x += 1
		l += 1
		if x == b:
			if l < a:
				x -= 1
				i += 1
				continue
			x = 0
			l = 0
		i += 1
	print(''.join(s))


s = 'abcdefghijklmnopqrstuvwxyz'
for _ in range(int(input())):
	(n, a, b) = map(int, input().split())
	sub = ['z' for i in range(a)]
	for i in range(b - 1):
		sub[i] = s[i]
	ans = []
	for i in range(n):
		ans.append(sub[i % a])
	print(*ans, sep='')


mass = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
for i in range(int(input())):
	(n, a, b) = map(int, input().split())
	counter = n // a + 1
	mas = []
	helper = ''
	pod = ''
	counter2 = 1
	if b != 1:
		pod = 'a' * (a - b + 1)
		for i in range(a - (a - b + 1)):
			if counter2 < 26:
				pod += mass[counter2]
				counter2 += 1
			else:
				counter2 = 1
				pod += mass[counter2]
		pod = pod * counter
		answer = pod[:n]
	else:
		pod = 'a'
		pod *= n
		answer = pod
	print(answer)


def read_int():
	return int(input().strip())

def read_ints():
	return list(map(int, input().strip().split(' ')))

def solve():
	(n, a, b) = read_ints()

	def generate():
		while True:
			for _ in range(a - b + 1):
				yield 'a'
			yield from 'bcdefghijklmnopqrstuvwxyz'[:b - 1]
	return ''.join([c for (_, c) in zip(range(n), generate())])
T = read_int()
for _ in range(T):
	print(solve())


import string
letters = string.ascii_lowercase
for _ in range(int(input())):
	(n, a, b) = map(int, input().split())
	s = ''
	while len(s) < n:
		t = b - 1
		s += (a - t) * 'a'
		for i in range(1, t + 1):
			s += letters[i]
	print(s[:n])


t = int(input())
for _ in range(t):
	[n, a, b] = [*map(int, input().split())]
	letters = [chr(97 + i) for i in range(b)]
	multiply = a - b + 1
	motif = ''
	for i in range(b):
		if i == 0:
			motif += multiply * letters[i]
		else:
			motif += letters[i]
	res = motif * (n // a + 1)
	res = res[:n]
	print(res)


from random import choice
tst_cs = int(input())
alpha = [chr(x) for x in range(97, 123)]
for x in range(tst_cs):
	(st_len, sub_len, dst_ch) = [int(k) for k in input().split()]
	word = ''
	while len(word) < dst_ch:
		ch = choice(alpha)
		if ch not in word:
			word += ch
	while len(word) < st_len:
		k = st_len - len(word)
		if k >= len(word):
			word += word
		else:
			word += word[:k]
	print(word)


t = int(input())
for _ in range(t):
	(n, a, b) = map(int, input().split())
	char = 97
	substr = ''
	distinct = 0
	for i in range(a):
		if distinct + 1 < b:
			substr += chr(char)
			distinct += 1
			char += 1
		else:
			substr += chr(char)
	times = n // a
	ans = substr * times
	if n % a != 0:
		extra = substr[:n % a]
		ans += extra
	print(ans)


from math import ceil
z = 'abcdefghijklmnopqrstuvwxyz'
T = int(input())
for t in range(T):
	i = input().split(' ')
	n = int(i[0])
	a = int(i[1])
	b = int(i[2])
	s = z[:b] * ceil(n / b)
	print(s[:n])


for _ in range(int(input())):
	(n, a, b) = map(int, input().split())
	ans = ''
	ans = 'a' * (a - b + 1)
	for lola in range(97, 97 + b - 1):
		ans = ans + chr(lola + 1)
	abc = n // a
	ans = ans * abc
	abc = n % a
	if abc != 0:
		ans = ans + ans[0:abc]
	print(ans)


t = int(input())
for tc in range(t):
	s = input().split()
	(n, a, b) = (int(s[0]), int(s[1]), int(s[2]))
	st = ''
	for i in range(b):
		st += chr(97 + i)
	le = st[b - 1]
	for i in range(a - b):
		st += le
	for i in range(n):
		ca = i % a
		print(st[ca], end='')
	print()


al = 'abcdefghijklmnopqrstuvwxyz'
for _ in range(int(input())):
	(n, a, b) = map(int, input().split())
	s = al[:b]
	c = s * (a // b) + s[:a % b]
	v = c * (n // a) + c[:n % a]
	print(v)


t = int(input())
mapp = list('abcdefghijklmnopqrstuvwxyz')
for test in range(t):
	(n, a, b) = list(map(int, input().split()))
	s = mapp[:b]
	s = s * (n // b + 1)
	x = ''.join(s)
	print(x[:n])


from sys import stdin
inp = lambda : stdin.readline().strip()
t = int(inp())
for i in range(t):
	(n, a, b) = [int(x) for x in inp().split()]
	needC = [a] * b
	final = []
	for i in range(b):
		needC[i] = chr(97 + i)
	for i in range(n):
		final.append(needC[i % b])
	s = ''.join(final)
	print(s)


import string
import random
t = int(input())
for i in range(t):
	ll = [int(i) for i in input().split(' ')]
	letter = []
	count = 0
	while count != ll[2]:
		let = random.choice(string.ascii_letters).lower()
		if let not in letter:
			letter.append(let)
			count += 1
	strings = ''
	for k in range(ll[0]):
		strings += letter[k % ll[2]]
	print(strings)


for T in range(int(input())):
	(n, a, b) = map(int, input().split())
	x = 0
	sd = 97
	for i in range(n):
		if x == a:
			x = 0
			sd = 97
		print(chr(sd), end='')
		x += 1
		if x < b:
			sd += 1
	print()


t = int(input())
while t:
	t -= 1
	(n, a, b) = tuple(map(int, input().split()))
	l = [chr(97 + i) for i in range(b)]
	for i in range(a - b):
		l.append(l[-1])
	l = ''.join(map(str, l))
	l = l * (n // len(l)) + l[:n % len(l)]
	print(l)


t = int(input())
for _ in range(t):
	(n, a, b) = map(int, input().split())
	init = ''.join([chr(ord('a') + i) for i in range(b)])
	answer = init * (n // b) + init[:n % b]
	print(answer)


t = int(input())
for i in range(t):
	a = list(map(int, input().split()))
	b = [chr(j) for j in range(97, 97 + a[2])]
	s = ''.join(b)
	print(s * (a[0] // a[2]), end='')
	if a[0] % a[2] != 0:
		print(s[:a[0] % a[2]], end='')
	print(end='\n')


for _ in range(int(input())):
	(n, a, b) = map(int, input().split())
	res = ''
	j = 0
	for i in range(n):
		res += chr(97 + i % b)
	print(res)


s = 'abcdefghijklmnopqrstuvwxyz'
for i in range(int(input())):
	(n, a, b) = map(int, input().split())
	uni_string = s[:a]
	len_pointer = 0
	string_pointer = 0
	res = ''
	while len_pointer < n:
		if string_pointer >= b:
			string_pointer = 0
		res += uni_string[string_pointer]
		string_pointer += 1
		len_pointer += 1
	print(res)


for i in range(int(input())):
	l = [int(i) for i in input().split()]
	al = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
	(n, a, b) = (l[0], l[1], l[2])
	nsl = n // a
	rest = n % a
	s = ''
	for i in range(b):
		s += al[i]
	s += (a - b) * al[b - 1]
	restsl = s[:rest]
	print(s * nsl + restsl)


t = int(input())
res = []
for i in range(t):
	(n, a, b) = map(int, input().split())
	alf = 'abcdefghijklmnopqrstuvwxyz'
	s = ''
	while len(s) <= n:
		s += alf[0:b]
	if len(s) > n:
		r = len(s) - n
		s = s[:len(s) - r]
	res.append(s)
for m in res:
	print(m)


t = int(input())
i = 0
A = 'abcdefghijklmnopqrstuvwxyz3'
B = []
while i < t:
	i += 1
	(a, b, c) = map(int, input().split())
	d = int(a / c) + 1
	e = A[0:c] * d
	B.append(e[0:a])
for x in B:
	print(x)


t = int(input())

def fun(n, a, b):
	ap = 'qwertyuiopasdfghjklzxcvbnm'
	ap = list(ap)
	ap.sort()
	s = ''
	s += (a - b + 1) * 'a'
	del ap[0]
	for i in range(b - 1):
		s += ap[i]
	l = list(s)
	for i in range(n - a):
		s += l[i % a]
	print(s)
while t:
	t -= 1
	(n, a, b) = map(int, input().split())
	fun(n, a, b)


def solve(n, k, d):
	rep = alpha[0] * (k - (d - 1)) + alpha[1:d]
	crep = ''
	for _ in range(n // k):
		crep += rep
	crep += rep[:n % k]
	print(crep)
alpha = 'abcdefghijklmnopqrstuvwxyz'
for _ in range(int(input())):
	(n, k, d) = map(int, input().split())
	solve(n, k, d)


from string import ascii_lowercase
length = int(input())
for i in range(length):
	(strLen, substrLen, nletters) = map(int, input().split(' '))
	substr = ascii_lowercase[:nletters]
	substr += ascii_lowercase[0] * (substrLen - nletters)
	nsubstr = strLen // substrLen
	result = substr * nsubstr + substr[:strLen % substrLen]
	print(result)


import sys
reader = (s.rstrip() for s in sys.stdin)
input = reader.__next__
inamo = 'qwertyuiopasdfghjklzxcvbnm'

def gift():
	for _ in range(t):
		(n, a, b) = list(map(int, input().split()))
		kap = inamo[:b]
		yield (kap * (n // b) + kap[:n % b])
t = int(input())
ans = gift()
print(*ans, sep='\n')


t = int(input())
ch = 'abcdefghijklmnopqrstuvwxyz'
for _ in range(t):
	(n, a, b) = map(int, input().split())
	s = ch[:b]
	for i in range(0, a - b):
		s = s + 'a'
	nt = len(s)
	for i in range(nt, n):
		s = s + s[i - nt]
	print(s)


import math
t = int(input())
alfa = 'abcdefghijklmnopqrstuvwxyz'
for _ in range(t):
	(n, a, b) = map(int, input().split())
	b1 = alfa[0:b]
	temp = math.ceil(n / b)
	a1 = b1 * temp
	print(a1[0:n])


t = int(input())
for i in range(t):
	p = ord('a')
	(n, a, b) = map(int, input().split())
	for j in range(1, n + 1):
		print(chr(p), end='')
		if j % b == 0:
			p = ord('a')
		else:
			p = p + 1
	print()


T = int(input())
C = 'abcdefghilmnopqrstuvzxyjkw'
for T in range(0, T):
	D = list(map(int, input().split()))
	n = D[0]
	a = D[1]
	b = D[2]
	x = n // 26
	y = x + 1
	Q = C * y
	if a == 1:
		Z = Q[0:n]
	else:
		R = Q[0:b]
		l = 0
		while l < n:
			R = R + R
			l = len(R)
		Z = R[0:n]
	print(Z)


import math
import os
import random
import re
import sys
t = int(input())
for i in range(t):
	(n, a, b) = [int(s) for s in input().split()]
	list = []
	for i in range(b):
		c = chr(97 + i)
		list.append(c)
	for i in range(a - b):
		list.append('a')
	for i in range(n - a):
		list.append(list[i])
	print(*list, sep='')


tt = int(input())
alp = 'abcdefghijklmnopqrstuvwxyz'
for _ in range(0, tt):
	(n, a, b) = list(map(int, input().split()))
	sub_str = alp[0:b]
	ans = sub_str * (n // b)
	sub_str = sub_str[0:n % b]
	ans = ans + sub_str
	print(ans)


for tc in range(int(input())):
	(n, a, b) = map(int, input().split(' '))
	s0 = 'abcdefghijklmnopqrstuvwxyz'
	r = n % b
	print(n // b * s0[:b] + s0[:r])


alphabet = 'abcdefghijklmnopqrstuvwxyz'
t = int(input())
for _ in range(t):
	(n, a, b) = [int(i) for i in input().split()]
	(n_repeats, len_partial) = divmod(n, b)
	block = alphabet[:b]
	constructed = block * n_repeats + block[:len_partial]
	print(constructed)


n = int(input())
s = 'abcdefghijklmnopqrstuvwxyz'
for i in range(n):
	(l, a, b) = map(int, list(input().split()))
	ns = s[:b]
	while ns.__len__() < l:
		ns = ns + ns
	ns = ns[:l]
	print(ns)


t = int(input())
alpha = 'a'
letters = []
for i in range(0, 26):
	letters.append(alpha)
	alpha = chr(ord(alpha) + 1)
for _ in range(t):
	(n, a, b) = list(map(int, input().rstrip().split()))
	uq_ltrs = letters[:b]
	ans = []
	j = 0
	for i in range(0, n):
		if j == b:
			j = 0
		ans.append(uq_ltrs[j])
		j += 1
	ans = ''.join(ans)
	print(ans)


n = int(input())
for x in range(n):
	s = list(map(int, input().split()))
	k = 0
	w = ''
	for z in range(s[0]):
		if k >= s[2]:
			k = 0
		w = w + chr(97 + k)
		k += 1
	print(w)


import sys
import string
input = sys.stdin.readline
tc = int(input())
for _ in range(tc):
	t = string.ascii_lowercase
	(n, a, b) = map(int, input().split())
	k = 0
	for i in range(n):
		print(t[k], end='')
		k = (k + 1) % b
	print()


t = int(input())
c = 'qwertyuiopasdfghjklzxcvbnm'
for i in range(t):
	(n, a, b) = map(int, input().split(' '))
	s = []
	while len(s) < n:
		for j in range(b):
			s.append(c[j])
			if len(s) == n:
				break
		if len(s) == n:
			break
		for k in range(a - b):
			s.append(c[b - 1])
			if len(s) == n:
				break
	print(*s, sep='')


for _ in range(int(input())):
	(n, a, b) = map(int, input().split())
	s = ''
	p = b
	for i in range(a):
		s += chr(96 + b)
		b = b - 1 if b > 1 else 1
	rem = n % a
	if rem > 0:
		print(s * (n // a), end='')
		b = p
		for i in range(rem):
			print(chr(96 + b), end='')
			b = b - 1 if b > 1 else 1
	else:
		print(s * (n // a))
	print()


for i in range(int(input())):
	(n, a, b) = map(int, input().split())
	s = 'a'
	for j in range(1, n):
		s += chr(j % b + 97)
	print(s)


i = 0
t = int(input())
while i < t:
	(n, a, b) = [int(x) for x in input().split()]
	alpha = 'a'
	test_list = []
	for j in range(0, b):
		test_list.append(alpha)
		alpha = chr(ord(alpha) + 1)
	j = 0
	m = 0
	for j in range(n):
		for k in range(b):
			if m < n:
				print(str(test_list[k]), end='')
				m = m + 1
			else:
				break
	print()
	i = i + 1


t = int(input())
for i in range(t):
	(n, a, b) = map(int, input().strip().split())
	a1 = 'abcdefghijklmnopqrstuvwxyz'
	a2 = a1[:b]
	a3 = n % len(a2)
	print(a2 * int(n / b), a1[:a3], sep='')


def solve(n, p, r):
	c = [0] * r
	start = 97
	for i in range(r):
		c[i] = chr(start + i)
	ans = ''
	for i in range(n):
		index = i % r
		ans += c[index]
	return ans
test = int(input())
for i in range(test):
	(n, p, r) = list(map(int, input().split()))
	res = solve(n, p, r)
	print(res)


T = int(input())
for _ in range(T):
	(n, a, b) = list(map(int, input().split()))
	ans = []
	for i in range(n):
		ans.append(chr(ord('a') + i % b))
	ans = ''.join(ans)
	print(ans)


t = int(input())
for i in range(t):
	(n, a, b) = map(int, input().split())
	start = 97
	if a == b:
		for i in range(n):
			print(chr(start), end='')
			start = start + 1 if start + 1 <= 122 else 97
	else:
		for i in range(n):
			print(chr(start), end='')
			start = start + 1 if start + 1 < 97 + b else 97
	print('\n', end='')


alp = 'abcdefghijklmnopqrstuvwxyz'
for _ in range(int(input())):
	(n, a, b) = map(int, input().split())
	k = alp[:b] * (n // b) + alp[:n % b]
	print(k)


n = int(input())
nab = [list(map(int, input().split())) for i in range(n)]
alp = 'abcdefghijklmnopqrstuvwxyz'
for i in nab:
	s = alp[0:i[2]] * (i[0] // i[2]) + alp[0:i[0] % i[2]]
	print(s)


n = int(input())
for i in range(n):
	t = list(map(int, input().split(' ')))
	ch = 'a'
	ans = []
	for i in range(t[1] - t[2]):
		ans.append(ch)
	for i in range(t[2]):
		ans.append(ch)
		ch = str(chr(ord(ch) + 1))
	for i in range(t[0] - t[1]):
		ans.append(ans[i])
	for i in ans:
		print(i, end='')
	print('')


t = int(input())
for qwe in range(t):
	(n, a, b) = map(int, input().split())
	alf = 'abcdefghijklmnopqrstuvwxyz'
	frag = alf[:b]
	ost = alf[:n % b]
	print(frag * (n // b) + ost)


import string
t = int(input())
result = []
for i in range(t):
	inputtolist = input().split(' ')
	inputtolist = list(map(int, inputtolist))
	n = inputtolist[0]
	a = inputtolist[1]
	b = inputtolist[2]
	subs = string.ascii_lowercase[:b]
	tmp = ''
	while len(tmp) < n:
		tmp += subs
	tmp = tmp[:n]
	result.append(tmp)
for r in result:
	print(r)


def getString(n, a, b):
	Str = ''
	pointer = 97
	for i in range(n):
		if i % b == 0:
			pointer = 97
		Str += chr(pointer)
		pointer += 1
	return Str
t = int(input())
for i in range(t):
	(n, a, b) = map(int, input().split(' '))
	print(getString(n, a, b), '\n')


t = int(input())
alpha = 'abcdefghijklmnopqrstuvwxyz'
for _ in range(t):
	(n, a, b) = map(int, input().split())
	sub = alpha[:b]
	ans = sub * (n // b) + sub[:n % b]
	print(ans)


for i in range(int(input())):
	(n, a, b) = map(int, input().split())
	c = []
	for i in range(n):
		c.append(chr(97 + i % b))
	print(''.join((str(i) for i in c)))


T = int(input())
for t in range(T):
	(n, a, b) = map(int, input().split())
	l = []
	for i in range(a):
		l.append(chr(ord('a') + i % b))
	while len(l) < n:
		l *= 2
	print(''.join(l[:n]))


T = int(input())
ref = ''.join([chr(97 + i) for i in range(26)])
for test in range(T):
	(N, A, B) = list(map(int, input().split()))
	base = ''
	for i in range(A):
		if i < B:
			base += ref[i]
		else:
			base += ref[0]
	rep = N // A + 1
	base *= rep
	base = base[:N]
	print(base)


from math import floor, ceil
t = int(input())
ans = []

def one(b, a):
	ret = ''
	for i in range(a):
		ret += chr(ord('a') + i)
	for i in range(b - a):
		ret += 'a'
	return ret
for _ in range(t):
	(n, a, b) = map(int, input().split())
	s = (one(a, b) * ceil(n / a))[:n]
	ans.append(s)
print(*ans, sep='\n')


alpha = list(map(chr, range(97, 123)))
for _ in range(int(input())):
	nab = input().split()
	b = int(nab[2])
	sb = ''.join(alpha[:b])
	a = int(nab[1])
	sa = sb * (a // b) + sb[:a % b]
	n = int(nab[0])
	sn = sa * (n // a) + sa[:n % a]
	print(sn)


t = int(input())
for _ in range(t):
	(n, a, b) = map(int, input().split())
	s = ''
	alp = 'abcdefghijklmnopqrstuvwxyz'
	for i in range(n):
		if i < b:
			s += alp[i]
		elif i < a:
			s += 'a'
		else:
			s += s[i - a]
	print(s)


for t in range(int(input())):
	(n, a, b) = map(int, input().split())
	x = ''
	for i in range(n):
		if i + 1 <= b:
			x = x + chr(97 + i)
		else:
			x = x + x[i - b]
	print(x)


import math
for x in range(int(input())):
	(n, a, b) = map(int, input().split())
	s = ''
	counter = 0
	for i in range(n):
		s += chr(ord('a') + i % b)
	print(s)


t = int(input())
A = 'abcdefghijklmnopqrstuvwxyz'
for _ in range(t):
	(n, a, b) = map(int, input().split())
	s = A[0:b]
	s = s * (n // b + 1)
	s = s[:n]
	print(s)


import sys, os.path
if os.path.exists('input.txt'):
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')
sys.setrecursionlimit(10 ** 5)

def II():
	return int(sys.stdin.readline())

def MI():
	return map(int, sys.stdin.readline().split())

def LI():
	return list(map(int, sys.stdin.readline().split()))

def solve():
	(n, a, b) = MI()
	l = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
	str = ''
	_ = 0
	__ = 0
	while len(str) != n:
		if b != 1:
			if _ == b:
				_ = 0
			str += l[_]
			_ += 1
		else:
			for _ in range(n):
				str += l[0]
	print(str)
for _ in range(II()):
	solve()


t = int(input())
for _ in range(t):
	(n, a, b) = map(int, input().split())
	s = 'abcdefghijklmnopqrstuvwxyz'
	if a == b:
		for i in range(n):
			j = i // 26
			print(s[i - 26 * j], end='')
	elif n == a:
		for i in range(b):
			print(s[i], end='')
		for i in range(n - b):
			print(s[b - 1], end='')
	else:
		while n // a >= 1:
			for i in range(a):
				if i < b:
					print(s[i], end='')
				else:
					print(s[b - 1], end='')
			n -= a
		for i in range(n):
			if i < b:
				print(s[i], end='')
			else:
				print(s[b - 1], end='')
	print()


import string

def solve(n, a, b):
	ar = []
	for i in range(n):
		ar.append(chr(97 + i % b))
	print(''.join(ar))
t = int(input())
for _ in range(t):
	(n, a, b) = map(int, input().split())
	solve(n, a, b)


for _ in range(int(input())):
	(n, a, b) = list(map(int, input().split()))
	print(('abcdefghijklmnopqrstuvwxyz'[:b] * n)[:n])


def string_construct(n, a, b):
	if a == b:
		return ''.join(map(chr, (ord('a') + i % 26 for i in range(n))))
	else:
		letters = []
		j = 0
		for _ in range(n):
			letters.append(chr(ord('a') + j % 26))
			j = (j + 1) % b
		return ''.join(letters)
t = int(input())
for t_itr in range(t):
	arr = list(map(int, input().rstrip().split()))
	n = int(arr[0])
	a = int(arr[1])
	b = int(arr[2])
	result = string_construct(n, a, b)
	print(result)


q = int(input())
for _ in range(q):
	(n, a, b) = map(int, input().split())
	lutiy_kek = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'.lower()
	print((lutiy_kek[:b] + (a - b) * 'a') * (n // a) + (lutiy_kek[:b] + (a - b) * 'a')[:n % a])


t = int(input())
while t > 0:
	t -= 1
	(n, a, b) = map(int, input().split())
	x = 97
	l = []
	i = 0
	while i < b:
		l.append(chr(x))
		x += 1
		i += 1
	i -= 1
	x -= 1
	while i < a - 1:
		l.append(chr(x))
		i += 1
	i = 0
	while i < n - a:
		l.append(l[i])
		i += 1
	print(''.join(l))


t = int(input())
for _ in range(t):
	(n, a, b) = map(int, input().split())
	answer = ''
	list = 'abcdefghijklmnopqrstuvwxyz'
	dictionary = [i for i in list]
	dictionary = list[:b]
	for i in range(n):
		answer += list[i % len(dictionary)]
	print(answer)


l = 'abcdefghijklmnopqrstuvwxyz'
for _ in range(int(input())):
	(n, a, b) = map(int, input().split())
	li = []
	s = l[:b] * (a // b) + l[:a % b]
	res = s[:] * (n // a) + s[:n % a]
	print(res)


from math import gcd
from collections import Counter

def printYes():
	print('YES')

def printNo():
	print('NO')
t = int(input())
for i in range(t):
	(n, a, b) = map(int, input().split())
	res = ''
	c = 97
	for i in range(a):
		res = res + chr(c)
		b = b - 1
		if b > 0:
			c = c + 1
	r = n // a
	q = n % a
	resd = r * res + res[:q]
	print(resd)


from sys import stdin, stdout
t = int(input())
s = ''
for i in range(97, 123):
	s = s + chr(i)
for i in range(t):
	(n, a, b) = map(int, input().split())
	s1 = s[:b]
	x = a % b
	y = a // b
	ans1 = y * s1 + s[:x]
	x1 = n % a
	y1 = n // a
	ans = ans1 * y1 + ans1[:x1]
	stdout.write(ans + '\n')


for _ in range(int(input())):
	(n, a, b) = map(int, input().split())
	s = 'abcdefghijklmnopqrstuvwxyz'
	temp = s[:b]
	v = 0
	ans = ''
	while v <= n:
		ans += temp
		temp[::-1]
		v += b
	print(ans[:n])


from string import ascii_lowercase
Testcase = int(input())
for i in range(Testcase):
	Inputs = list(map(int, input().split()))
	StrLen = Inputs[0]
	SubstrLen = Inputs[1]
	Distinct = Inputs[2]
	MyDistinct = 0
	ANS = []
	for j in range(StrLen):
		ANS.append(ascii_lowercase[MyDistinct])
		if MyDistinct == Distinct - 1:
			MyDistinct = 0
		else:
			MyDistinct = (MyDistinct + 1) % 26
	print(''.join(ANS))


for q_ in range(int(input())):
	(n, a, b) = map(int, input().split())
	j = 0
	s = ''
	for i in range(n):
		s += chr(ord('a') + j)
		j = (j + 1) % b
	print(s)


t = int(input())
alf = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
for test in range(t):
	ans = ''
	(n, a, b) = map(int, input().split())
	for i in range(b):
		ans += alf[i]
	v = n // b
	z = ans
	for i in range(v - 1):
		ans += z
	ans += ans[:n - len(ans)]
	print(ans)


for _ in range(int(input())):
	(n, a, b) = map(int, input().split())
	s = ''
	for i in range(b):
		s = s + chr(97 + i)
	s = s * (n // b)
	if b > 1:
		for j in range(n % b):
			s = s + chr(97 + j)
		print(s, end='')
	else:
		for i in range(n):
			print('a', end='')
	print()


def main():
	t = int(input())
	for _ in range(t):
		print(case())

def case():
	(n, a, b) = map(int, input().split())
	char = 'abcdefghijklmnopqrstuvwxyz'
	ss = char[0:b] * (b // a) + char[0:b % a]
	return ss * (n // b) + char[0:n % b]
main()


from sys import stdin, stdout
from math import gcd, sqrt, floor, ceil
input = stdin.readline

def list_inp(x):
	return list(map(x, input().split()))

def map_inp(x):
	return map(x, input().split())

def lcm(a, b):
	return a * b / gcd(a, b)
s = 'abcdefghijklmnopqrstuvwxyz'
t = int(input())
for _ in range(t):
	(n, a, b) = map_inp(int)
	print((s[:b] * n)[:n])


import string
t = int(input())
al = list(string.ascii_lowercase)
for i in range(t):
	result = []
	(n, a, b) = [int(x) for x in input().split()]
	b = b - 1
	for i in range(a):
		if b > 0:
			result.append(al[b])
			b -= 1
		else:
			result.append(al[b])
	j = n % a
	k = n // a
	result = result * k + result[:j]
	print(''.join(result))


import math
t = int(input())
for i in range(t):
	(n, a, b) = input().split()
	n = int(n)
	a = int(a)
	b = int(b)
	s = ''
	m = a
	for i in range(0, b):
		s = s + chr(97 + i)
	d = n // b
	s1 = ''
	for i in range(0, d):
		s1 = s1 + s
	n = n - d * b
	if n == 0:
		print(s1)
	else:
		s1 = s1 + s[0:n]
		print(s1)


for i in range(int(input())):
	(x, y, z) = map(int, input().split())
	l = 'abcdefghijklmnopqrstuvwxyz'
	k = int(x / z)
	s = l[:z] * k
	j = x % z
	s += l[:j]
	print(s)


t = int(input())
for _ in range(t):
	(n, a, b) = [int(x) for x in input().split()]
	sa = ''
	distinct = ''
	for i in range(b):
		distinct += chr(ord('a') + i)
	i = 0
	while i < n:
		sa += distinct
		i += b
	s = ''
	for j in range(n):
		s += sa[j]
	print(s)


t = int(input())
for tc in range(t):
	(n, a, b) = list(map(int, input().split()))
	s = ''
	for i in range(b):
		s += chr(ord('a') + i)
	ch = s[-1]
	for i in range(a - b):
		s += ch
	for i in range(n):
		print(s[i % a], end='')
	print('')


letters = 'abcdefghijklmnopqrstuvwxyz'
T = int(input())
for i in range(T):
	(n, a, b) = list(map(int, input().split()))
	base = letters[0:b]
	o = ''
	while n:
		if n >= len(base):
			o += base
			n -= len(base)
		else:
			o += base[0:n]
			n = 0
	print(o)


from sys import stdin
t = int(stdin.readline())
for _ in range(t):
	(n, a, b) = map(int, stdin.readline().split())
	ans = ''
	cur = 0
	while len(ans) < n:
		ans += chr(ord('a') + cur)
		cur += 1
		cur = cur % b
	print(ans)


def main_function():
	t = int(input())
	for _ in range(t):
		(n, a, b) = list(map(int, input().split()))
		alphabet = 'abcdefghijklmnopqrstuvwxyz'
		new_str = alphabet[:b]
		new_str *= n // b + 1
		new_str = new_str[:n]
		print(new_str)
main_function()


from string import ascii_lowercase as alps
for _ in range(int(input())):
	(n, a, b) = map(int, input().split())
	s = ''
	for i in range(n):
		s += alps[i % b]
	print(s)


def main():
	t = int(input())
	st = 'abcdefghijklmnopqrstuvwxyz'
	tp = []
	for i in st:
		tp.append(i)
	for i in range(t):
		p = input().split(' ')
		p = [int(j) for j in p]
		ans = ''
		pp = 0
		for j in range(p[1]):
			ans = ans + tp[pp]
			if pp < p[2] - 1:
				pp = pp + 1
			else:
				pp = 0
		pp = 0
		for j in range(p[0] - p[1]):
			ans = ans + tp[pp]
			if pp < p[2] - 1:
				pp = pp + 1
			else:
				pp = 0
		print(ans + '\n')
main()


t = int(input())
for ii in range(t):
	(n, a, b) = map(int, input().split())
	al = 'qwertyuiopasdfghjklzxcvbnm'
	ans = ''
	for i in range(b):
		ans += al[i]
	for j in range(a - b):
		ans += ans[-1]
	m = n // a
	mod = n % a
	print(ans * m + ans[:mod])


s = 'abcdefghijklmnopqrstuvwxyz'
t = int(input())
for _ in range(t):
	(n, a, b) = map(int, input().split())
	s1 = ''
	for i in range(b):
		s1 += s[i]
	d = a // b
	s2 = ''
	for i in range(d):
		s2 += s1
	d = a % b
	if d > 0:
		for i in range(d):
			s2 += s1[i]
	k = n // a
	s3 = ''
	for i in range(k):
		s3 += s2
	k = n % a
	if k > 0:
		for i in range(k):
			s3 += s2[i]
	print(s3)


test_cases = int(input())
for i in range(test_cases):
	(word_size, sub_string, distincts) = map(int, input().split())
	alpha = 'abcdefghijklmnopqrstuvwxyz'
	distinct_word = alpha[:distincts]
	word = distinct_word
	size = word_size // distincts + 1
	word = word * size
	print(word[:word_size])


import sys
input = sys.stdin.readline

def inp():
	return int(input())

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

def insr():
	s = input()
	return list(s[:len(s) - 1])

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

def print_list_int(l):
	print(' '.join(map(str, map(int, l))))
t = inp()
letters = list('abcdefghijklmnopqrstuvwxyz')
for i in range(t):
	(n, a, b) = inlt()
	print(''.join(list(letters)[:b] * int(n // b + 1))[:n])


from string import ascii_lowercase as alphabets
t = int(input())
for _ in range(t):
	(n, a, b) = map(int, input().split())
	alpha_lst = []
	for i in range(b):
		alpha_lst.append(alphabets[i])
	if len(alpha_lst) != n:
		i = 0
		while len(alpha_lst) != n:
			alpha_lst += alpha_lst[i]
			i += 1
			if i > n - 1:
				i = 0
	print(*alpha_lst, sep='')


for _ in range(int(input())):
	(n, a, b) = map(int, input().split())
	s = []
	a = ''
	for i in range(97, 97 + b):
		s.append(chr(i))
		a += s[i - 97]
	x = int(n / b)
	print(a * x, end='')
	k = n - x * b
	for i in range(97, 97 + k):
		print(chr(i), end='')
	print('')


test = int(input())

def solve():
	n = list(map(int, input().split()))
	k = []
	i = 0
	for x in range(n[0]):
		i += 1
		if x % n[2] == 0:
			p = 97
			i = 0
		k.append(chr(97 + i))
	print(*k, sep='')
for x in range(test):
	solve()


s = 'abcdefghijklmnopqrstuvwxyz'
t = int(input())
while t > 0:
	(n, a, b) = map(int, input().strip().split())
	rep = n // b
	add = n % b
	print(s[:b] * rep + s[:add])
	t -= 1


import sys

def data():
	return sys.stdin.buffer.readline().strip()
out = sys.stdout.write

def mdata():
	return map(int, data().split())
for i in range(int(data())):
	(n, a, b) = mdata()
	s = 'abcdefghijklmnopqrstuvwxyz'
	s1 = s[:b]
	ans = s1 * (n // b) + s1[:n % b]
	out(ans + '\n')


for _ in range(int(input())):
	(n, a, b) = map(int, input().split())
	l = 'abcdefghijklmnopqrstuvwxyz'
	A = l[:b] * (a // b) + l[:a - b * (a // b)]
	for i in range(n - a):
		A += A[i]
	print(A)


t = int(input())
while t > 0:
	(n, a, b) = input().split()
	n = int(n)
	a = int(a)
	b = int(b)
	ans = ''
	alpha = 'abcdefghijklmnopqrstuvwxyz'
	for x in range(0, b):
		ans += alpha[x]
	sz = len(ans)
	while sz < a:
		ans += ans[sz - 1]
		sz += 1
	while sz < n:
		ans += ans[sz - a]
		sz += 1
	print(ans)
	t -= 1


def foo(n, a, b):
	q = s[:b]
	f = n // b
	q = q * f
	f = n % b
	q += s[:f]
	return q
s = 'abcdefghijklmnopqrstuvwxyz'
t = int(input())
for i in range(t):
	(n, a, b) = [int(x) for x in input().split()]
	print(foo(n, a, b))


t = int(input().strip())
for i in range(t):
	(n, a, b) = map(int, input().split())
	s = []
	for i in range(n):
		s.append(chr(ord('a') + i % b))
	print(''.join(s))


for _ in range(int(input())):
	(n, a, b) = map(int, input().split())
	t = ''
	g = 97
	f = 0
	for i in range(n):
		t += chr(g + f)
		f += 1
		f = f % b
	print(t)


for _ in range(int(input())):
	(n, a, b) = map(int, input().split())
	s = ''
	for i in range(b):
		s += chr(ord('a') + i)
	t = str(s)
	s += t * ((n - len(s)) // b)
	rem = (n - len(s)) % b
	if rem:
		for i in range(rem):
			s += chr(ord('a') + i)
	print(s)


t = int(input())
while t > 0:
	t = t - 1
	l = input().split()
	n = int(l[0])
	s = int(l[1])
	c = int(l[2])
	l = []
	for i in range(c):
		if i > 25:
			l.append(chr((97 + i) % 123 + 97))
		else:
			l.append(chr(97 + i))
	r = ''
	for i in range(n):
		r = r + l[i % c]
	print(r)


test_count = int(input())
for _ in range(test_count):
	(n, a, b) = map(int, input().split())
	answer = ''
	for i in range(n):
		answer += str(chr(ord('a') + i % b))
	print(str(answer))


import sys

def I():
	return sys.stdin.readline().rstrip()
for _ in range(int(I())):
	(n, a, b) = map(int, I().split())
	bs = ''.join((chr(i + ord('a')) for i in range(b)))
	sa = ''.join((bs[i % b] for i in range(a)))
	s = ''
	while n > len(s):
		s += sa
	print(s[:n])


t = int(input())
ss = []
for i in range(0, t):
	(n, a, b) = map(int, input().split())
	s = ''
	if a == b:
		for i in range(0, n):
			s += chr(97 + i % 26)
		ss.append(s)
	elif b == 1:
		for i in range(0, n):
			s += chr(97)
		ss.append(s)
	else:
		for i in range(0, n):
			s += chr(97 + i % b)
		ss.append(s)
for i in range(0, t):
	print(ss[i])


t = int(input())
for _ in range(t):
	(n, a, b) = map(int, input().strip().split())
	alpha = 'abcdefghijklmnopqrstuvwxyz'
	ans = ''
	ans += alpha[:b]
	diff = a - b
	ans += alpha[b - 1] * diff
	count = n // a + 1
	final = ans * count
	print(final[:n])


import math
al = [chr(ord('a') + i) for i in range(26)]
T = int(input())
for i in range(T):
	(n, a, b) = map(int, input().split())
	ans = ''
	t = 0
	for j in range(a):
		ans += al[t]
		t += 1
		if t == b:
			t = 0
	tmp = math.ceil(n / a)
	ans *= tmp
	if len(ans) == n:
		print(ans)
	else:
		ans = ans[:n - len(ans)]
		print(ans)


T = int(input())
for _ in range(T):
	(n, a, b) = map(int, input().split())
	s = 'a' * (a - b + 1)
	for j in range(b - 1):
		s = s + chr(98 + j)
	s1 = s * (n // a)
	for i in range(n % a):
		s1 = s1 + s[i]
	print(s1)


from itertools import cycle
alpha = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
t = int(input())
for _ in range(t):
	(n, a, b) = map(int, input().split())
	p = cycle(alpha[:b])
	stri = ''
	i = 0
	for j in p:
		stri = stri + j
		i = i + 1
		if i >= n:
			break
	print(stri)


def constructString(n, a, b):
	res = [97 + i % b for i in range(n)]
	return ''.join((chr(i) for i in res))
t = int(input())
for i in range(t):
	(n, a, b) = map(int, input().split())
	print(constructString(n, a, b))


x = 'abcdefghijklmnopqrstuvwxyz'
for _ in range(int(input())):
	(n, a, b) = list(map(int, input().split()))
	subb = (x[:b] * (a // b + 1))[:a]
	for i in range(n):
		print(subb[i % a], end='')
	print()


from string import ascii_lowercase
t = int(input())
for _ in range(t):
	(n, a, b) = map(int, input().split())
	ans = [0] * n
	letters = ascii_lowercase
	j = 0
	for i in range(a):
		if b > 0:
			curr_letter = letters[j]
			j += 1
			b -= 1
		ans[i] = curr_letter
	j = 0
	prev_letter = ans[j]
	for i in range(a, n):
		ans[i] = prev_letter
		j += 1
		prev_letter = ans[j]
	print(''.join(ans))


def cons(n):
	alpha = 'abcdefghijklmnopqrstuvwxyz'
	return alpha[0:n]
for i in range(int(input())):
	(n, a, b) = [int(i) for i in input().split()]
	q = n // b
	rem = n % b
	ans = cons(b) * q + cons(rem)
	print(ans)


t = int(input())
while t != 0:
	(n, a, b) = input().split()
	n = int(n)
	a = int(a)
	b = int(b)
	while n != 0:
		x = 'a'
		for i in range(b):
			print(x, end='')
			j = ord(x)
			j = j + 1
			x = chr(j)
			n = n - 1
			if n == 0:
				break
	t = t - 1
	print()


for _ in range(int(input())):
	(n, a, b) = map(int, input().split())
	s = ''
	i = 0
	x = 96
	while i < b and i < a and (i < n):
		x += 1
		s = s + chr(x)
		i += 1
	if a > b:
		i = 0
		while i < a - b and i < n:
			s = s + chr(x)
			i += 1
	j = a
	i = 0
	while j < n:
		s = s + s[i]
		j += 1
		i += 1
	print(s)


for _ in range(int(input())):
	(N, a, b) = list(map(int, input().split()))
	for i in range(N):
		print(chr(ord('a') + i % b), end='')
	print()


import sys

def main():
	t = int(input())
	alphabet = 'abcdefghijklmnopqrstuvwxyz'
	for _ in range(t):
		(n, a, b) = map(int, sys.stdin.readline().split())
		ans = 'a' * (a - b)
		ans += alphabet[:b]
		while len(ans) < n:
			ans += ans[-a]
		print(ans)
	return
main()


def ans(n, a, b):
	x = n
	s = ''
	dic = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
	dic1 = dic[:b]
	while x >= b:
		for i in dic1:
			s = s + i
			x -= 1
	dic1 = dic[:x]
	for i in dic1:
		s = s + i
	return s
n = int(input())
for i in range(n):
	m = input().split()
	a = []
	for i in m:
		a.append(int(i))
	print(ans(a[0], a[1], a[2]))


T = int(input())
alpha = 'abcdefghijklmnopqrstuvwxyz'
for t in range(T):
	(N, A, B) = map(int, input().split())
	ans = ''
	for n in range(N):
		ans += alpha[n % B]
	print(ans)


voc = 'qwertyuiopasdfghjklzxcvbnm'
for i in range(int(input())):
	(n, a, b) = map(int, input().split())
	lst = ['.' for j in range(b)]
	lst[:b] = voc[:b] * (n // b + 1)
	del lst[n:len(lst)]
	print(''.join(lst))


from sys import stdin
import math
inp = stdin.readline
t = int(inp().strip())
while t:
	t -= 1
	(n, a, b) = [int(k) for k in inp().strip().split()]
	ans = ''
	for i in range(n):
		ans += chr(97 + i % b)
	print(ans)


import sys
readline = sys.stdin.readline
for _ in range(int(input())):
	(n, a, b) = map(int, readline().split())
	s = [chr(cc) for cc in range(97, 97 + b)]
	s += s[-1] * (a - b)
	s *= (n + a - 1) // a
	print(*s[:n], sep='')


for _ in range(int(input())):
	(n, a, b) = map(int, input().split(' '))
	ans = ''
	x = 0
	temp = b
	for i in range(0, a):
		ans += chr(ord('a') + x)
		if temp > 1:
			x += 1
		temp -= 1
	ans = ans * int(n / a)
	x = 0
	temp = b
	for i in range(0, n % a):
		ans += chr(ord('a') + x)
		if temp > 1:
			x += 1
		temp -= 1
	print(ans)


for _ in range(int(input())):
	(n, k, d) = map(int, input().split())
	s = ''
	i = 97
	j = 2 * d
	for _ in range(d):
		s = s + chr(i)
		i += 1
	a = s
	while j < n:
		s = s + a
		j = j + d
	s = s + s[0:n - (j - d)]
	print(s)


tests = int(input())
s = 'abcdefghijklmnopqrstuvwxyz'
for i in range(tests):
	query = input().split(' ')
	(n, a, b) = (int(query[0]), int(query[1]), int(query[2]))
	ans = s[:b] * (n // b)
	ans += s[:n % b]
	print(ans)


from string import ascii_lowercase
from collections import defaultdict

def f(n, a, b):
	ret = ''
	s = set()
	d = defaultdict(int)
	flag = False
	for ch in ascii_lowercase:
		ret += ch
		if ch not in s:
			s.add(ch)
		d[ch] += 1
		if len(s) == b:
			while len(ret) < a:
				ret += ch
				d[ch] += 1
			flag = True
		if flag:
			break
	while len(ret) < n:
		rem_idx = len(ret) - a
		d[ret[rem_idx]] -= 1
		if d[ret[rem_idx]] == 0:
			s.remove(ret[rem_idx])
			for ch in ascii_lowercase:
				if ch not in s:
					ret += ch
					d[ch] += 1
					s.add(ch)
					break
		else:
			ret += ret[rem_idx]
			d[ret[rem_idx]] += 1
	return ret

def main():
	t = int(input())
	for _ in range(t):
		l = map(int, input().split())
		print(f(*l))
main()


t = int(input())
for _ in range(t):
	(n, a, b) = map(int, input().split())
	alphabet = 'abcdefghijklmnopqrstuvwxyz'
	out = ''
	for i in range(n):
		out += alphabet[i % b]
	print(out)


from sys import stdin, stdout
for _ in range(int(stdin.readline())):
	(n, sl, d) = map(int, stdin.readline().split())
	s = 'a' * (sl - d + 1)
	ch = 98
	for i in range(1, d):
		s += chr(ch)
		ch += 1
	for i in range(n):
		stdout.write(s[i % sl])
	print()


m = 'abcdefghijklmnopqrstuvwxyz'
for i in range(int(input())):
	(n, a, b) = map(int, input().split())
	s = m[:b]
	if n - b <= b:
		s = s + s[:n - b]
	else:
		s = s * (n // b) + s[:n % b]
	print(s)


try:
	t = int(input())
	for _ in range(t):
		(n, a, b) = map(int, input().split())
		A = []
		for i in range(a - b + 1):
			A.append('a')
		for i in range(98, 98 + b - 1):
			A.append(chr(i))
		A = A * (n // a + 1)
		A = A[:n]
		print(''.join(A))
except:
	pass


t = int(input())
for I in range(t):
	(n, a, b) = map(int, input().split())
	s = ''
	for i in range(97, 97 + b):
		s += chr(i)
	p = n // b
	c = ''
	for i in range(p):
		c += s
	if n % b != 0:
		p = n % b
		for i in range(p):
			c += s[i]
	print(c)


import string
import math
cnt = int(input())
for i in range(cnt):
	(n, a, b) = (int(s) for s in input().split())
	result = (string.ascii_lowercase[:b] * math.ceil(n / b))[:n]
	print(result)


t = int(input())
for _ in range(t):
	(n, a, b) = map(int, input().split())
	s = 'abcdefghijklmnopqrstuvwxyz'
	c = s[:b]
	if a > b:
		c += 'a' * (a - b)
	v = c * (n // a)
	v += c[:n % a]
	print(v)


t = int(input())
letters = 'qwertyuiopasdfghjklzxcvbnm'
while t:
	t -= 1
	(n, a, b) = list(map(int, input().split(' ')))
	l = letters[:b]
	ll = n // b
	lll = n % b
	s = l * ll + l[:lll]
	print(s)


for _ in range(int(input())):
	s = ''
	(n, a, b) = map(int, input().split())
	c = 97
	length = 0
	for i in range(n):
		if length == b:
			c = 97
			length = 0
		s += chr(c)
		c += 1
		length += 1
	print(s)


def convertArrayToInt(A):
	for i in range(0, len(A), 1):
		A[i] = int(A[i])
	return A
testCases = int(input())

def generateString(size, substringSize, distinctChars):
	ans = ''
	substring = ''
	for i in range(0, substringSize, 1):
		substring += chr(ord('a') + i % distinctChars)
	i = 0
	while len(ans) != size:
		ans += substring[i % substringSize]
		i += 1
	return ans
while testCases:
	X = input().split()
	X = convertArrayToInt(X)
	n = X[0]
	a = X[1]
	b = X[2]
	print(generateString(n, a, b))
	testCases -= 1


T = int(input())
abcd = 'abcdefghijklmnopqrstuvwxyz'
for t in range(T):
	a = input()
	(a, b, c) = list(map(int, a.split(' ')))
	arr_b = list(abcd[:c])
	while len(arr_b) < b:
		arr_b.append(abcd[c - 1])
	chars = []
	idx = 0
	b_idx = 0
	while idx < a:
		chars.append(arr_b[b_idx])
		idx += 1
		b_idx += 1
		if b_idx == b:
			b_idx = 0
	print(''.join(chars))


import sys
from string import ascii_lowercase
t = int(sys.stdin.readline().rstrip())

def main():
	for _ in range(t):
		(n, a, b) = map(int, sys.stdin.readline().split())
		use = ascii_lowercase[:b]
		s = ''
		for i in range(b):
			c = (a + (b - i) - 1) // (b - i)
			s += use[i] * c
			a -= c
		while len(s) < n:
			s += use
		print(s[:n])
main()


import math
test = int(input())
li = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
while test:
	arr = list(map(int, input().split()))
	string = ''.join(li[:arr[2]])
	string = string * math.ceil(arr[0] / arr[2])
	print(string[:arr[0]])
	test -= 1


def solve():
	(n, a, b) = list(map(int, input().split()))
	s = []
	char = 0
	for i in range(n):
		s.append(chr(ord('a') + i % b))
	print(''.join(s))

def main():
	t = int(input())
	for _ in range(t):
		solve()
main()


for i in range(int(input())):
	(n, a, b) = input().split()
	(n, a, b) = (int(n), int(a), int(b))
	ascii_letters = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
	res = ''
	for i in range(b):
		res += ascii_letters[i]
	res = str(res)
	print(res * (n // b) + res[:n - n // b * b])


for t in range(int(input())):
	(length, y, x) = map(int, input().split())
	string = 'abcdefghijklmnopqrstuvwxyz'
	leng = ''
	for i in range(x):
		leng += string[i]
	leng = leng * (length // x + 1)
	print(leng[0:length])


def solve(a, b, c):
	pool = []
	s = 'abcdefghijklmnopqrstuvwxyz'
	ss = []
	for i in range(c):
		pool.append(s[i])
	for x in range(b):
		ss.append(pool[x % len(pool)])
	final = []
	for x in range(a):
		final.append(ss[x % len(ss)])
	print(''.join(final))

def main():
	t = int(input())
	for _ in range(t):
		(a, b, c) = [int(x) for x in input().split()]
		solve(a, b, c)
main()


sdash = 'qwertyuiopasdfghjklzxcvbnm'
for i in range(int(input())):
	(n, a, b) = map(int, input().split())
	s = str()
	while len(s) < n:
		s += sdash[:b]
	print(s[:n])


from collections import Counter
t = int(input())
for _ in range(t):
	(n, a, b) = map(int, input().split())
	res = ''
	p = 0
	for i in range(n):
		res += chr(p % b + 97)
		p += 1
	print(res)


for i in range(int(input())):
	(n, a, b) = list(map(int, input().split()))
	p = 0
	for i in range(0, n, b):
		for i in range(97, 97 + b):
			print(chr(i), end='')
			p += 1
			if p >= n:
				break
	print('')


t = int(input())
for x in range(t):
	(n, a, b) = map(int, input().split())
	h = ''
	for x in range(b):
		h += chr(x + 97)
	for x in range(b, a):
		h += h[-1]
	an = (h * (n // len(h)) * 2)[:n]
	print(an)


def distribution(n):
	return (n - 1) // 2

def problem_A():
	print(distribution(int(input())))
s = 'abcdefghijklmnopqrstuvwxyz'

def cons_str(n, b):
	a = s[:b]
	ans = ''
	while n > b:
		ans += a
		n -= b
	ans += a[:n]
	return ans

def problem_B():
	(n, a, b) = list(map(int, input().split()))
	print(cons_str(n, b))

def comp_teams(a):
	if len(a) < 2:
		return 0
	s = len(set(a))
	if s == len(a):
		return 1
	a.sort()
	t = 0
	temp = 1
	for i in range(1, len(a)):
		if a[i] == a[i - 1]:
			temp += 1
		else:
			if t < temp:
				t = temp
			temp = 1
	if t < temp:
		t = temp
	if s <= t - 1:
		return s
	if s == t:
		return s - 1
	else:
		return t

def problem_C():
	l = int(input())
	a = list(map(int, input().split()))
	print(comp_teams(a))

def antisudoku(a):
	for i in range(9):
		for j in range(9):
			if a[i][j] == '2':
				a[i][j] = '1'
	return a

def problem_D():
	a = []
	for _ in range(9):
		a.append(list(input()))
	b = antisudoku(a)
	for i in range(9):
		print(''.join(b[i]))

def three_block_palindrome(s):
	a = []
	b = []
	c = []
	l = len(s)
	for _ in range(l):
		a = []
		for _ in range(l + 1):
			a.append([0] * 26)
	l += 1
	for i in range(1, l):
		k = s[i - 1] - 1
		for j in range(26):
			a[i][j] = a[i - 1][j]
		a[i][k] += 1
	maxlength = 0
	for i in range(l):
		for j in range(i, l):
			maxa = 0
			maxb = 0
			for k in range(26):
				if a[l - 1][k] - a[j][k] > a[i][k]:
					if maxa < a[i][k]:
						maxa = a[i][k]
				elif maxa < a[l - 1][k] - a[j][k]:
					maxa = a[l - 1][k] - a[j][k]
				if maxb < a[j][k] - a[i][k]:
					maxb = a[j][k] - a[i][k]
			if maxlength < 2 * maxa + maxb:
				maxlength = 2 * maxa + maxb
	return maxlength

def problem_E1():
	l = int(input())
	s = list(map(int, input().split()))
	print(three_block_palindrome(s))
cases = int(input())
for _ in range(cases):
	problem_B()


t = int(input())
for i in range(t):
	(n, a, b) = map(int, input().split())
	str = ''
	cur = ord('a')
	for j in range(b):
		str += chr(cur + j)
	print(str * (n // len(str)) + str[:n % len(str)])


from sys import stdin
from collections import deque
mod = 10 ** 9 + 7
import sys
import random
from queue import PriorityQueue
from bisect import bisect_right
from bisect import bisect_left
from collections import defaultdict
from math import sqrt, factorial, gcd, log2, inf, ceil
import heapq
input = lambda : sys.stdin.readline().rstrip()
from sys import stdin, stdout
from heapq import heapify, heappush, heappop
from itertools import permutations
from math import factorial as f

def ncr(n, r, p):
	num = den = 1
	for i in range(r):
		num = num * (n - i) % p
		den = den * (i + 1) % p
	return num * pow(den, p - 2, p) % p

def solve(n):
	return n * (n + 1) // 2
t = int(input())
for i in range(t):
	(n, a, b) = map(int, input().split())
	ans = []
	cnt = 0
	yo = 97
	for i in range(a):
		if cnt != b:
			ans.append(chr(yo))
			yo += 1
			cnt += 1
		else:
			ans.append(ans[-1])
	hash = defaultdict(int)
	for i in ans:
		hash[i] += 1
	ha = 0
	for i in range(a, n):
		z = ans[ha]
		ans.append(z)
		ha += 1
	print(''.join(ans))


import math
for _ in range(int(input())):
	(n, a, b) = map(int, input().split())
	s = []
	j = 97
	for i in range(b):
		s.append(chr(j))
		j += 1
	ans = []
	i = 0
	while n != 0:
		ans.append(s[i])
		i += 1
		n -= 1
		if i >= b:
			i = 0
	ans = ''.join(ans)
	print(ans)


t = int(input())
for x in range(t):
	[n, a, b] = list(map(int, input().split()))
	d = 'abcdefghijklmnopqrstuvwxyz'
	s = ''
	l = [a // b + 1] * b
	for i in range(b - a % b):
		l[b - 1 - i] -= 1
	for i in range(b):
		s += d[i] * l[i]
	for i in range(n - a):
		s += s[i]
	print(s)


t = int(input())
for _ in range(t):
	(n, a, b) = map(int, input().split())
	s = 97
	(rep, ct) = (a - b, 0)
	while ct != n:
		c = s
		for i in range(b):
			if ct >= n:
				break
			print(chr(c), end='')
			ct += 1
			c += 1
		for i in range(rep):
			if ct >= n:
				break
			print(chr(min(c - 1, 122)), end='')
			ct += 1
	print('')


for i in range(int(input())):
	(n, a, b) = map(int, input().split())
	s = ''
	if a == b:
		for j in range(b):
			s += chr(j + 97)
	else:
		for j in range(b):
			s += chr(j + 97)
	s1 = s
	while len(s) < n:
		for j in s1:
			if len(s) == n:
				break
			else:
				s += j
	print(s)


def constructString(n, a, b):
	string = ''
	x = 0
	currentChar = 97
	for i in range(a):
		x = x % b
		string += chr(currentChar + x)
		x += 1
	for i in range(n - a):
		x = x % b
		string += chr(currentChar + x)
		x += 1
	print(string)
testCases = int(input())
for t in range(testCases):
	inp = list(map(int, input().split()))
	n = inp[0]
	a = inp[1]
	b = inp[2]
	constructString(n, a, b)


def generate_string(n, a, b):
	string = 'abcdefghijklmnopqrstuvwxyz'
	idx = 0
	ans_string = ''
	while len(ans_string) < n:
		ans_string += chr(ord('a') + idx % b)
		idx += 1
	return ans_string
t = int(input())
for i in range(t):
	(n, a, b) = [int(j) for j in input().split()]
	ans = generate_string(n, a, b)
	print(ans)


import math
for w in range(int(input())):
	n = list(map(int, input().split()))
	alpha = list('qwertyuiopasdfghjklzxcvbnm')
	st = []
	for i in range(n[2]):
		st.append(alpha[i])
	for i in range(n[2], n[1]):
		st.append(alpha[0])
	for i in range(n[1], n[0]):
		st.append(st[i - n[1]])
	print(''.join(st))


t = int(input())
for i in range(t):
	(n, m, k) = map(int, input().split())
	p = m // k
	q = m % k
	s = ''
	for j in range(k):
		s += chr(j + 97)
	o = s[:q]
	a = [s] * p
	l = ''.join(a)
	d = l + o
	w = n // m
	r = n % m
	x = d[:r]
	a = [d] * w
	print(''.join(a) + x)


l = 'abcdefghijklmnopqrstuvwxyz'
for _ in range(int(input())):
	(n, a, b) = map(int, input().split())
	l1 = l[:b]
	s = []
	for i in range(n):
		s.append(l1[i % len(l1)])
	print(''.join(s))


import math
t = int(input())
for _ in range(t):
	(n, a, b) = list(map(int, input().rstrip().split()))
	s = ''
	if b == a:
		for i in range(n):
			s += chr(i % 26 + 97)
		print(s)
		continue
	for i in range(b):
		s += chr(i + 97)
	g = s[-1]
	for i in range(a - b):
		s += g
	for i in range(a, n):
		s += s[i - a]
	print(s)


t = int(input())
ans = []
for i in range(t):
	(n, a, b) = map(int, input().split())
	x = ''
	j = 0
	while n > 0:
		i = 0
		for j in range(b):
			x = x + chr(ord('a') + i)
			i += 1
			j += 1
			n -= 1
			if n == 0:
				break
			if i == 26:
				i = 0
	ans.append(x)
for j in range(t):
	print(ans[j])


def main():
	alp = 'abcdefghijklmnopqrstuvwxyz'
	t = int(input())
	for f in range(t):
		(n, a, b) = map(int, input().split())
		s = ''
		ind = 0
		while n > 0:
			if ind >= b:
				ind = 0
			s += alp[ind]
			ind += 1
			n -= 1
		print(s)
main()


t = int(input())
result = []
rlist = []
inputvalues = []
j = 0
alphabet = 'abcdefghijklmnopqrstuvwxyz'
for i in range(t):
	nab = input()
	nabList = list(map(int, str.split(nab)))
	inputvalues += [nabList]
for i in range(t):
	j = 0
	rlist = []
	while j < inputvalues[i][0]:
		for k in range(inputvalues[i][2]):
			rlist += alphabet[k]
			j += 1
			if j == inputvalues[i][0]:
				break
	result += [rlist]
for i in range(t):
	for k in range(len(result[i])):
		print(result[i][k], end='')
	print(end='\n')


t = int(input())
r = 'abcdefghijklmnopqrstuvwxyz'
for i in range(t):
	(n, a, b) = [int(x) for x in input().split()]
	s1 = r[:b] * (n // b) + r[:n % b]
	print(s1)


import sys, math, cmath, time
start_time = time.time()

def inp():
	return int(input())

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

def insr():
	s = input()
	return s[:len(s) - 1]

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

def solve():
	(n, a, b) = invr()
	q = 'abcdefghijklmnopqrstuvwxyz'[:b]
	q = q + q[-1] * (a - b)
	q = q * math.ceil(n / len(q))
	print(q[:n])
ONLINE_JUDGE = __debug__
if not ONLINE_JUDGE:
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')
else:
	input = sys.stdin.readline
t = 1
t = inp()
for tt in range(t):
	solve()
if not ONLINE_JUDGE:
	print('Time Elapsed:', time.time() - start_time, 'seconds')
sys.stdout.close()


T = int(input())
t = 0
while t < T:
	L = list(map(int, input().split()))
	l = L[0]
	a = L[1]
	b = L[2]
	alphabet = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
	s = ''
	q = 0
	while len(s) < l:
		if q == b:
			q = 0
		s = s + alphabet[q]
		q = q + 1
	print(s)
	t = t + 1


for q in range(int(input())):
	(n, a, b) = map(int, input().split())
	cu = 97
	str = ''
	for i in range(b):
		str += chr(cu)
		cu += 1
	tmp = a - b
	str = 'a' * tmp + str
	S = str
	tmp = n - a + 1
	tmp -= 1
	for i in range(tmp):
		str += str[i]
	print(str)


for t in range(int(input())):
	(n, a, b) = map(int, input().split())
	l = []
	for i in range(97, 97 + b):
		l.append(chr(i))
	s = ''
	for j in range(n):
		s += l[j % len(l)]
	print(s)


t = int(input())
for test in range(t):
	ans = ''
	(n, a, b) = input().split()
	(n, a, b) = (int(n), int(a), int(b))
	suba = ''
	counter = 0
	for i in range(a):
		suba += chr(counter + 97)
		if counter != b - 1:
			counter += 1
	counter = 0
	for i in range(n):
		ans += suba[counter]
		counter += 1
		if counter == a:
			counter = 0
	print(ans)


import sys
input = sys.stdin.readline
t = int(input())
for _ in range(t):
	(n, a, b) = map(int, input().split())
	sub = []
	cnt = 0
	idx = -1
	res = ''
	alpha = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
	while True:
		if len(sub) == a:
			break
		if cnt == b:
			sub.append(alpha[idx])
		elif cnt < b:
			idx += 1
			cnt += 1
			sub.append(alpha[idx])
	sub = ''.join(sub)
	while True:
		if len(res) == n:
			break
		if len(sub) + len(res) <= n:
			res += sub
		elif n > len(res):
			res += sub[:n - len(res)]
	print(res)


I = lambda : list(map(int, input().split()))
z = 'abcdefghijklmnopqrstuvwxyz'
for _ in range(int(input())):
	(n, a, b) = I()
	s = z[:b] * (a // b) + z[:a % b]
	print(s * (n // a) + s[:n % a])


ab = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
for i in range(int(input())):
	(n1, a1, b1) = map(int, input().split())
	li = []
	if a1 == b1:
		for i in range(n1 // a1):
			li += ab[:a1]
		li += ab[:n1 % a1]
	elif b1 == 1:
		for i in range(n1):
			li.append('a')
	else:
		for i in range(n1 // a1 + 1):
			li += ab[:b1] + [ab[b1 - 1] for j in range(a1 - b1)]
		li = li[:n1]
	print(''.join(li))


def array_to_string(a):
	s = ''
	for i in a:
		s += str(i)
	return s
t = int(input())
while t > 0:
	t = t - 1
	(n, a, b) = map(int, input().split())
	idx = 0
	ar = [0 for i in range(n)]
	for i in range(n):
		lett = chr(idx + 97)
		ar[i] = lett
		idx = (idx + 1) % b
	print(array_to_string(ar))


import sys
input = sys.stdin.readline
t = int(input())
for tests in range(t):
	(n, a, b) = map(int, input().split())
	ANS = []
	for i in range(n):
		ANS.append(chr(i % b + 97))
	print(''.join(ANS))


from sys import stdin, stdout
t = int(stdin.readline())
while t > 0:
	(n, a, b) = map(int, list(stdin.readline().split()))
	res = ''
	for i in range(n):
		res += chr(ord('a') + i % b)
	stdout.write(str(res))
	stdout.write('\n')
	t -= 1


def inp():
	return int(input())

def inpl():
	return list(map(int, input().split()))
t = inp()
for _ in range(t):
	(n, a, b) = inpl()
	ans = ''
	tmp = 0
	for i in range(n):
		ans += chr(97 + tmp)
		tmp = (tmp + 1) % b
	print(ans)


for _ in range(int(input())):
	(n, a, b) = map(int, input().split())
	s = 'abcdefghijklmnopqrstuvwxyz'
	ans = s[:b]
	ans += ans[0] * (a - b)
	if len(ans) < n:
		n -= a
		ans += ans * (n // a) + ans[:n % a]
	print(ans)


import string
for i in range(int(input())):
	(n, a, b) = map(int, input().split())
	res = string.ascii_lowercase[:b] * n
	print(res[:n])


ncases = int(input())
alphabets = 'abcdefghijklmnopqrstuvwxyz'
for i in range(ncases):
	nab = input().split(' ')
	nabint = []
	for ele in nab:
		nabint.append(int(ele))
	strlength = nabint[0]
	sublength = nabint[1]
	dis = nabint[2]
	if strlength == sublength or sublength == dis:
		a = int(strlength / dis)
		b = int(strlength % dis)
		string = a * alphabets[0:dis] + alphabets[0:b]
		print(string)
	else:
		ss = alphabets[0:dis]
		d = sublength - dis
		c = strlength - d
		e = int(c / dis)
		f = int(c % dis)
		string = d * alphabets[0] + e * alphabets[0:dis] + alphabets[0:f]
		print(string)


t = int(input())
for i in range(t):
	(n, a, b) = map(int, input().split())
	ans = ''
	s = 'qwertyuiopasdfghjklzxcvbnm'
	for i in range(n // b):
		ans += s[:b]
	temp = len(ans)
	ans += s[:n - temp]
	print(ans)


l = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
for _ in range(int(input())):
	(n, a, b) = map(int, input().split())
	if b == 1:
		s = 'a' * n
	else:
		ss = ''
		for i in range(b):
			ss += l[i]
		s = ss * (n // b) + ss[:n % b]
	print(s)


import math as mt
import sys, string, bisect
input = sys.stdin.readline
import random
from collections import deque, defaultdict
L = lambda : list(map(int, input().split()))
Ls = lambda : list(input().split())
M = lambda : map(int, input().split())
I = lambda : int(input())
d = defaultdict(int)
x = 'abcdefghijklmnopqrstuvwxyz'
t = I()
for _ in range(t):
	(n, a, b) = M()
	p = x[:b]
	i = 0
	while len(p) < n:
		p += p[i]
		i += 1
	print(p)


for _ in range(int(input())):
	(n, a, b) = map(int, input().split())
	arr = []
	for i in range(n):
		arr.append(chr(ord('a') + i % b))
	st = ''
	print(st.join(arr))


alphabet = 'abcdefghijklmnopqrstuvwxyz'
T = int(input())
for t in range(T):
	(n, a, b) = map(int, input().split())
	dist = alphabet[:b]
	times = n // b
	remain = n % b
	rez = dist * times
	if remain > 0:
		rez += dist[:remain]
	print(rez)


from bisect import bisect_left as lower_bound, bisect_right as upper_bound
from sys import stdin, stdout
from collections import defaultdict

def solve(arr, n):
	pass

def main():
	t = int(input())
	for _ in range(t):
		(n, a, b) = list(map(int, input().strip().split()))
		ret = []
		if a == 1:
			print('a' * n)
			continue
		for i in range(a - b + 1):
			ret.append('a')
		j = 0
		for i in range(a - b + 1, a):
			ret.append(chr(97 + j + 1))
			j += 1
		cnt = b
		for i in range(1, n):
			if i + a > n:
				break
			ret.append(ret[i - 1])
		print(''.join(ret))
main()


t = int(input())
alpha = 'abcdefghijklmnopqrstuvwxyz'
while t:
	(n, a, b) = map(int, input().split())
	s = alpha[0:b]
	ans = ''
	ans += s * (n // b)
	ans += s[0:n % b]
	print(ans)
	t -= 1


for i in range(int(input())):
	(n, a, b) = map(int, input().split())
	test = 'abcdefghijklmnopqrstuvwxyz'
	sub = ''
	for i in range(b):
		sub += test[i]
	sub2 = sub[:]
	for i in range(n - b):
		sub2 += sub[i % b]
	print(sub2)


from collections import deque, Counter

def solve(n, a, b):
	unused = set(map(chr, range(ord('a'), ord('z') + 1)))
	used = Counter()
	substr = deque([], a)
	result = []
	for _ in range(a):
		if len(used) < b:
			adding = unused.pop()
		else:
			adding = next(used.elements())
		substr.append(adding)
		used += Counter(adding)
	for _ in range(n - a):
		removing = substr.popleft()
		result.append(removing)
		used.subtract(removing)
		if used[removing] == 0:
			unused.add(removing)
		used = +used
		if len(used) < b:
			adding = unused.pop()
		else:
			adding = next(used.elements())
		substr.append(adding)
		used += Counter(adding)
	result.extend(substr)
	return ''.join(result)
num_cases = int(input())
for _ in range(num_cases):
	(n, a, b) = map(int, input().split())
	print(solve(n, a, b))


for _ in range(int(input())):
	(n, a, b) = map(int, input().split())
	num = 97
	total = 0
	while True:
		if n - total >= a:
			i = -1
			for i in range(97, 97 + b):
				print(chr(i), end='')
			for j in range(a - b):
				print(chr(i), end='')
			total += a
		else:
			i = -1
			for i in range(97, 97 + min(b, n - total)):
				print(chr(i), end='')
			for j in range(0, n - total - b):
				print(chr(i), end='')
			break
	print()


import string
letters = list(string.ascii_lowercase)
for tc in range(int(input())):
	(n, a, b) = [int(x) for x in input().split()]
	res = ''
	seenSoFar = []
	for i in range(a):
		if b:
			res += letters[i]
			b -= 1
			seenSoFar.append(letters[i])
		elif not b:
			res += seenSoFar[i % len(seenSoFar)]
	index = a
	while len(res) < n:
		res += seenSoFar[index % len(seenSoFar)]
		index += 1
	print(res)


import sys
I = sys.stdin.readline
ans = ''
s = 'abcdefghijklmnopqrstuvwxyz'
for _ in range(int(I())):
	(n, a, b) = map(int, I().split())
	m = ''
	for i in range(n // b):
		m += s[0:b]
	m += s[0:n % b]
	ans += m + '\n'
print(ans)


from sys import stdin, stdout
import string
T = int(stdin.readline())
for i in range(T):
	(n, a, b) = [int(x) for x in stdin.readline().split()]
	chars = string.ascii_lowercase[:26]
	pattern = chars[:b] + chars[b - 1] * (a - b)
	res = pattern * (n // a) + pattern[:n % a]
	stdout.write(str(res) + '\n')


from random import randint
t = int(input())
for i in range(t):
	s = ''
	(n, a, b) = map(int, input().split())
	x = ord('a')
	j = 0
	c = 0
	while j < n:
		s = s + chr(x)
		x += 1
		c += 1
		if c == b:
			x = ord('a')
			c = 0
		j += 1
	print(s)


T = int(input())
alphabet = 'abcdefghijklmnopqrstuvwxyz'
for t in range(T):
	line = [int(i) for i in input().split()]
	(n, a, b) = (line[0], line[1], line[2])
	list_ = [alphabet[:b] for i in range(int(n / b))]
	list_ += [alphabet[:n % b]]
	print(''.join(list_))


import string

def construct(n, a, b):
	return ((string.ascii_lowercase[:b] + 'a' * (a - b)) * (n // a + 1))[:n]
t = int(input())
for i in range(t):
	(n, a, b) = map(int, input().split())
	print(construct(n, a, b))


import math
for _ in range(int(input())):
	(n, a, b) = map(int, input().split())
	s = 'abcdefghijklmnopqrstuvwxyz'
	token = s[:b]
	ans = token * (n // b)
	ans += token[:n % b]
	print(ans)


for i in range(int(input())):
	(n, a, b) = map(int, input().split())
	p = n // b
	q = n % b
	d = []
	for i in range(b):
		d.append(chr(97 + i))
	d = ''.join(d)
	print(d * p + d[:q])


from sys import stdin, stdout
import math
from itertools import permutations, combinations
from collections import defaultdict
from bisect import bisect_left
from bisect import bisect_right

def L():
	return list(map(int, stdin.readline().split()))

def In():
	return map(int, stdin.readline().split())

def I():
	return int(stdin.readline())
P = 1000000007
for t in range(I()):
	(n, a, b) = In()
	st1 = ''
	for i in range(n):
		st1 += chr(97 + i % b)
	print(st1)


T = int(input())
for t in range(T):
	(n, a, b) = list(map(int, input().split()))
	c = 0
	s = ''
	for n in range(n):
		if n % a == 0:
			c = 0
		s = s + chr(c + ord('a'))
		if c < b - 1:
			c += 1
	print(s)


import sys
input = lambda : sys.stdin.readline().rstrip()
inp = sys.stdin.buffer.readline

def I():
	return list(map(int, inp().split()))
for _ in range(I()[0]):
	(n, a, b) = I()
	a = [chr(i) for i in range(97, 123)]
	ans = []
	for i in range(n):
		ans.append(a[i % b])
	print(''.join(ans))


T = int(input())
for t in range(T):
	(n, a, b) = map(int, input().split())
	s = ''
	for i in range(b):
		s += chr(ord('a') + i)
	while len(s) < a:
		s += 'a'
	out = s
	for i in range(n - a):
		out += s[i % len(s)]
	print(out)


import sys
import string
input = sys.stdin.readline

def inp():
	return int(input())

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

def insr():
	s = input()
	return list(s[:len(s) - 1])

def invr():
	return map(int, input().split())
tests = inp()
testcount = 0
while testcount < tests:
	(n, a, b) = invr()
	alphabet = string.ascii_lowercase
	baseString = alphabet[:b]
	finalString = ''
	while len(finalString) < n:
		finalString += baseString
	print(finalString[:n])
	testcount += 1


x = int(input())
for i in range(x):
	(n, m, k) = map(int, input().split())
	t = ''
	for i in range(97, 97 + k):
		t += chr(i)
	t = t * n
	t = t[:n]
	print(t)


s = 'abcdefghijklmnopqrstuvwxyz'
for t in range(int(input())):
	x = [int(i) for i in input().split()]
	n = x[0]
	a = x[1]
	b = x[2]
	q = n // b
	re = n % b
	r = s[0:b]
	c = 0
	op = ''
	while c < q:
		op += r
		c += 1
	op += s[0:re]
	print(op)


import sys

def func():
	return
for _ in range(int(input())):
	(n, a, b) = map(int, input().split())
	s = ''
	i = 97
	for j in range(b):
		s += chr(i)
		i += 1
	k = len(s)
	m = s * (n // k) + s[0:n % k]
	print(m)


import string
t = int(input())
for i in range(t):
	(n, a, b) = list(map(int, input().split()))
	s = string.ascii_lowercase
	sub = s[0:b] + (a - b) * s[b - 1]
	res = n // a * sub
	res += sub[0:n % a]
	print(res)


from sys import stdin, stdout
letters = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
for test in range(int(stdin.readline())):
	arr = [int(x) for x in stdin.readline().split()]
	n = arr[0]
	a = arr[1]
	b = arr[2]
	ans = ''
	if a == b:
		for i in range(n):
			ans = ans + str(letters[i % 26])
	else:
		for i in range(a):
			ans = ans + str(letters[i % b % 26])
		if n % a == 0:
			ans = ans * (n // a)
		else:
			t = ans[:n % a]
			ans = ans * (n // a) + t
	stdout.write(ans + '\n')


t = int(input())
for _ in range(t):
	(n, a, b) = map(int, input().split())
	p = b
	s = ''
	i = 97
	while b:
		s += chr(i)
		i += 1
		b -= 1
	s = s * (n // p)
	s += s[:n % p]
	print(s)


t = int(input())
for _ in range(t):
	(n, a, b) = list(map(int, input().strip().split()))[:3]
	ans = ''
	c = ord('a')
	f = 1
	for i in range(n):
		if i % a == 0:
			c = ord('a')
			f = 1
		ans += chr(c)
		c += f * 1
		if c - 96 > b or c - 96 < 1:
			f *= -1
			c += f * 1
	print(ans)


t = int(input())
for _ in range(t):
	(n, a, b) = map(int, input().split())
	s = 'a'
	for i in range(b - 1):
		s += chr(ord(s[-1]) + 1)
	n1 = n // b
	n2 = n % b
	s = s * n1
	s = s + s[0:n2]
	print(s)


for u in range(int(input())):
	(n, a, b) = map(int, input().split())
	x = ['a'] * a
	if b != 1:
		for i in range(b - 1):
			x[i] = chr(ord('a') + i + 1)
	ans = x * (n // a) + x[:n % a]
	print(''.join(ans))


import string
for _ in range(int(input())):
	(n, a, b) = map(int, input().split())
	(a1, b1) = divmod(a, b)
	(a2, b2) = divmod(n, a)
	st = string.ascii_lowercase
	s = st[:b]
	s1 = s * a1 + s[:b1]
	s2 = s1 * a2 + s1[:b2]
	print(s2)


import sys, bisect
from math import gcd
input = sys.stdin.readline

def inp():
	return int(input().rstrip())

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

def insr():
	s = input().rstrip()
	return s[:len(s) - 1]

def invr():
	return map(int, input().rstrip().split())
t = inp()
for _ in range(t):
	(n, a, b) = invr()
	part = []
	cnt = 97
	index = 0
	while index < b:
		part.append(chr(cnt))
		cnt += 1
		index += 1
	while index < a:
		part.append(part[-1])
		index += 1
	al = part * (n // a + 1)
	print(''.join(al[:n]))


t = int(input())
l = []
for i in range(t):
	x = ''
	(n, a, b) = map(int, input().split())
	for j in range(b):
		x += chr(ord('a') + j)
	z = x * (a // b) + x[0:a % b]
	zz = z * (n // a) + z[0:n % a]
	l.append(zz)
for i in range(t):
	print(l[i])


t = int(input())
for t1 in range(t):
	(n, a, b) = map(int, input().split())
	s = ''
	startNum = 96
	for i in range(b):
		startNum += 1
		s += chr(startNum)
	for i in range(b, a):
		s += chr(startNum)
	for i in range(a, n):
		s += s[i - a]
	print(s)


test = int(input())
for t in range(test):
	(n, a, b) = map(int, input().split())
	ans = ''
	for i in range(n):
		ans += chr(97 + i % b)
	print(ans)


def solve():
	latino = 'abcdefghijklmnopqrstuvwxyz'
	(n, a, b) = map(int, input().split())
	substr = latino[:b]
	cnt = (n + b - 1) // b
	print((substr * cnt)[:n])
t = int(input())
for _ in range(t):
	solve()


t = int(input())
for j in range(t):
	s = input().split()
	n = int(s[0])
	a = int(s[1])
	b = int(s[2])
	counta = 0
	countb = 97
	string = ''
	for i in range(n):
		string = string + chr(countb)
		countb += 1
		counta += 1
		if counta == b:
			counta = 0
			countb = 97
	print(string)


import sys
input = sys.stdin.buffer.readline
t = int(input())
for _ in range(t):
	(n, a, b) = [int(x) for x in input().split()]
	unit = []
	c = 0
	for i in range(a):
		if b > 0:
			unit.append(chr(ord('a') + c))
			c += 1
			b -= 1
		else:
			unit.append('a')
	unitStr = ''.join(unit)
	ans = ((n // a + 1) * unitStr)[:n]
	print(ans)


t = int(input())
for g in range(t):
	(n, a, b) = map(int, input().split())
	s = ''
	for i in range(b):
		s += chr(97 + i)
	for i in range(a - b):
		s = 'a' + s
	ans = s + ''
	ind = 0
	for i in range(len(s), n):
		ans += s[ind]
		ind = (ind + 1) % len(s)
	print(ans)


from sys import stdout
import io
import os
input = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline
for t in range(int(input())):
	(n, a, b) = map(int, input().split())
	s = ''
	for i in range(b):
		s += chr(97 + i)
	s += chr(96 + b) * (a - b)
	stdout.write(s * (n // a) + s[:n % a] + '\n')


ch = 'abcdefghijklmnopqrstuvwxyz'
t = int(input())
for q in range(t):
	(n, a, b) = map(int, input().split())
	s = ''
	d = ''
	for i in range(b):
		d += ch[i]
	for i in range(a - b):
		d += ch[b - 1]
	while len(s) < n:
		s += d
	print(s[0:n])


t = int(input())
base = 'abcdefghijklmnopqrstuvwxyz'
while t:
	t -= 1
	(n, a, b) = list(map(int, input().split()))
	ans = ''
	i = 0
	while i < n:
		j = 0
		while j < a and j + i < n:
			ans += base[j % b]
			j += 1
		i += a
	print(ans)


import sys
import os
from io import BytesIO, IOBase

def cel(n, k):
	return n // k + (n % k != 0)

def ii():
	return int(input())

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

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

def lcm(a, b):
	return abs(a * b) // math.gcd(a, b)

def prr(a, sep=' '):
	print(sep.join(map(str, a)))

def dd():
	return defaultdict(int)

def ddl():
	return defaultdict(list)

def ddd():
	return defaultdict(defaultdict(int))
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))
input = lambda : sys.stdin.readline().rstrip('\r\n')
from collections import defaultdict
for _ in range(ii()):
	(n, a, b) = mi()
	d = ''
	for i in range(97, 97 + b):
		d += chr(i)
	for i in range(a - b):
		d += chr(96 + b)
	tmp = n // a
	rem = n % a
	res = d * tmp
	for i in range(rem):
		res += d[i]
	print(res)


N = int(input())
for i in range(N):
	l = []
	p = 0
	A = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
	(n, a, b) = map(int, input().split())
	k = 0
	for i in range(b):
		l.append(A[k])
		k = k + 1
	if len(l) < n:
		j = 0
		for i in range(a - b):
			l.append(l[0])
		while len(l) < n:
			l.append(l[j])
			j = j + 1
	print(str(''.join(l)))


for q in range(int(input())):
	(n, a, b) = map(int, input().split())
	ans = ''
	for q in range(97, 97 + b):
		ans += chr(q)
	ans = ans * (n // b)
	ans += ans[:n % b]
	print(ans)


from collections import Counter
from math import ceil
a = ord('a')
alph = [chr(i) for i in range(a, a + 26)]
for _ in range(int(input())):
	(n, a, b) = list(map(int, input().strip().split()))
	my = alph[:b]
	for i in range(a - b):
		my.append(my[-1])
	fin = ''.join(my)
	al = n // a * fin
	also = n - len(al)
	also1 = fin[:also]
	print(al + also1)


s = 'abcdefghijklmnopqrstuvwxyz'
t = int(input())
for cas in range(t):
	(n, a, b) = list(map(int, input().split(' ')))
	ss = s[:b] + 'a' * (a - b)
	ans = ss * (n // a) + ss[:n % a]
	print(ans)


n = int(input())
for i in range(n):
	(n, a, b) = map(int, input().split())
	r = a / b
	t = a - b
	l = []
	for i in range(b):
		l.append(chr(97 + i))
	s = ''.join(l)
	if n % b == 0:
		r = n // b
		print(r * s)
	else:
		r = n // b
		y = n - b * r
		p = s[0:y]
		print(r * s + p)


from math import *
from collections import *
from operator import itemgetter
import bisect
ii = lambda : int(input())
iia = lambda : list(map(int, input().split()))
isa = lambda : list(input().split())
I = lambda : list(map(int, input().split()))
chrIdx = lambda x: ord(x) - 96
idxChr = lambda x: chr(96 + x)
t = ii()
for _ in range(t):
	(n, a, b) = iia()
	ar = ''
	for i in range(1, 27):
		ar += idxChr(i)
	d = ar[:b]
	l = 0
	c = 0
	ans = ''
	while l < n:
		if c % 2:
			ans += d[:min(n - l, b)]
			l += b
		else:
			ans += d[:min(n - l, b)]
			l += b
		c += 1
	print(ans)


t = int(input())
while t:
	(a, b, c) = map(int, input().split())
	s = 'abcdefghijklmnopqrstuvwxyz'
	s = s[:c]
	n = a // c + 1
	s = s * n
	s = s[:a]
	print(s)
	t -= 1


for i in range(int(input())):
	(n, a, b) = map(int, input().split())
	st = ''
	for j in range(b):
		st += chr(ord('a') + j)
	if b < a:
		st += 'a' * (a - b)
	st *= n // a + 1
	print(st[:n])


from string import ascii_lowercase
import math

def solve():
	(n, a, b) = map(int, input().split())
	ans = ''
	for i in range(n):
		ans += chr(ord('a') + i % b)
	print(ans)
t = int(input())
for _ in range(t):
	solve()


import math
import string
d = dict(zip(range(1, 27), string.ascii_lowercase))
t = int(input())
for _ in range(t):
	(n, a, b) = map(int, input().split())
	ans = ''
	i = 1
	while i <= a:
		ans += d[min(i, b)]
		i += 1
	x = n // a
	ans = ans * x
	r = n % a
	if r != 0:
		ans = ans + ans[0:r]
	print(ans)


t = int(input())
for i in range(t):
	(n, a, b) = map(int, input().split())
	s = ''
	ans = ''
	ch = ''
	for j in range(b):
		s += chr(ord('a') + j)
		ch = chr(ord('a') + j)
	for j in range(a - b):
		s += ch
	while len(ans) < n:
		if len(ans) + a > n:
			ans += s[:n - len(ans)]
			break
		else:
			ans += s
	print(ans)


from sys import stdin
import sys
for _ in range(int(stdin.readline())):
	(n, a, b) = map(int, stdin.readline().split())
	arr = list(map(chr, range(97, 123)))
	p = n // b
	new = arr[:b] * p + arr[:n - p * b]
	print(''.join(new))


t = int(input())
q = 'abcdefghijklmnopqrstuvwxyz'
for j in range(t):
	(n, a, b) = map(int, input().split())
	answer = ''
	for i in range(b):
		answer = answer + q[i]
	for i in range(a - b):
		answer = answer + answer[-1]
	for i in range(a, n):
		answer = answer + answer[i - a]
	print(answer)


t = int(input())
for _ in range(t):
	(n, a, b) = map(int, input().split())
	az = 'abcdefghijklmnopqrstuvwxyz'
	ans = ''
	k = 0
	for i in range(n):
		ans += az[k]
		k = (k + 1) % b
	print(ans)


T = int(input())
for _ in range(T):
	(n, a, b) = map(int, input().split())
	first_char = 97
	if a - b == 0:
		char_list = [chr(first_char + i) for i in range(26)]
	else:
		char_list = [chr(first_char + i) for i in range(b)]
	string = ''
	for i in range(n):
		idx = i % len(char_list)
		string += char_list[idx]
	print(string)


tc = int(input())
cases = []
for _ in range(tc):
	cases.append(list(map(int, input().split())))
for case in cases:
	(n, a, b) = case
	alphabets = 'abcdefghijklmnopqrstuvwxyz'
	s = 'a' * (a - b + 1)
	for i in range(b - 1):
		s += alphabets[i + 1]
	while len(s) < n:
		s *= 2
	print(s[:n])


def solve(n, a, b):
	letters = 'abcdefghijklmnopqrstuvwxyz'
	options = letters[:b]
	result = []
	for i in range(n):
		result.append(options[i % len(options)])
	return ''.join(result)
t = int(input())
for _ in range(t):
	(n, a, b) = map(int, input().split())
	result = solve(n, a, b)
	print(result)


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

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

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

def modInverse(p, a, m):
	return p * pow(a % m, m - 2, m) % m
for _ in range(int(input())):
	(n, a, b) = IntInput()
	p = 'abcdefghijklmnopqrstuvwxyz'
	subarray = (p[:b] * (a // b + 1))[:a]
	print((subarray * (n // a + 1))[:n])


def call():
	(n, a, b) = map(int, input().split())
	for i in range(n):
		k = i % b
		t = 97 + k
		print(chr(t), end='')
	print()
for i in range(int(input())):
	call()


t = int(input())
a = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
for i in range(t):
	arr = newList = list(map(int, input().split()))
	currentDistinct = 0
	aindex = 0
	s = ''
	for k in range(arr[1]):
		if currentDistinct < arr[2]:
			s += a[aindex]
			aindex += 1
			currentDistinct += 1
		else:
			s += a[aindex - 1]
	for k in range(1, arr[0] - arr[1] + 1):
		if arr[1] != 1:
			currSub = s[k:]
		else:
			currSub = []
		currSubset = set(currSub)
		currentDistinct = len(currSubset)
		if currentDistinct < arr[2]:
			for j in range(26):
				if a[j] not in currSubset:
					s += a[j]
					break
		else:
			s += s[-1]
	print(s)


st = 'abcdefghijklmnopqrstuvwxyz'
t = int(input())
while True:
	if t == 0:
		break
	t -= 1
	(n, a, b) = map(int, input().split())
	q = st[:b]
	while len(q) != a:
		q += q[len(q) - b]
	while len(q) != n:
		q += q[len(q) - a]
	print(q)


t = int(input())
while t:
	(n, a, b) = map(int, input().split())
	alpha = 'abcdefghijklmnopqrstuvwxyz'
	c = 0
	for i in range(n):
		if c == b:
			c = 0
		print(alpha[c], end='')
		c += 1
	print()
	t -= 1


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

def I():
	return int(input())

def S():
	return str(input())

def L():
	return list(R())
from collections import Counter
import math
import sys
from itertools import permutations
import bisect

def func(x):
	return s[x % (a * b)] + x // (a * b) * s[a * b - 1]
for _ in range(I()):
	(n, a, b) = R()
	s = ''.join([chr(i + ord('a')) for i in range(b)])
	s2 = ''.join([chr(i + ord('a')) for i in range(n % b)])
	print(s * (n // b) + s2)


t = int(input())
for _ in range(t):
	(n, a, b) = map(int, input().split())
	start = 97
	end = start + b
	i = 0
	sub = ''
	while i < a:
		sub += chr(start + i % b)
		i += 1
	i = 0
	ans = ''
	while i < n:
		ans += sub[i % a]
		i += 1
	print(ans)


t = int(input())
while t:
	inp = input().split(' ')
	n = int(inp[0])
	a = int(inp[1])
	b = int(inp[2])
	s = 'abcdefghijklmnopqrstuvwxyz'[:b]
	q = n // b
	r = n % b
	ans = s * q + s[:r]
	print(ans)
	t -= 1


alph = 'abcdefghijklmnopqrstuvwxyz'
t = int(input())
for i in range(t):
	(n, a, b) = input().split(' ')
	n = int(n)
	a = int(a)
	b = int(b)
	s = alph[0:b] * int(n / b)
	if n % b != 0:
		s += alph[0:n % b]
	print(s)


T = int(input())
for _ in range(1, T + 1):
	(n, a, b) = map(int, input().split())
	chrS = 97
	chrE = 122
	answer = ''
	if b == 1:
		answer = 'a' * n
	elif a == b:
		curChar = chrS
		while len(answer) < n:
			answer += chr(curChar)
			curChar += 1
			if curChar > chrE:
				curChar = chrS
	else:
		dif = a - b + 1
		curN = 0
		bord = a - dif
		curChar = chrS
		while len(answer) < n:
			answer += chr(curChar)
			if curN < bord:
				curChar += 1
			curN += 1
			if curN >= a:
				curN = 0
				curChar = chrS
	print(answer)


from string import ascii_lowercase
test_cases = int(input())
string_data = []

def create_unique(unique):
	index = ascii_lowercase
	patt = []
	start = 0
	while unique > 0:
		patt.append(index[start])
		start += 1
		unique -= 1
	return patt
while test_cases > 0:
	string_data.append(list(map(int, input().split())))
	test_cases -= 1
for i in range(0, len(string_data)):
	length = string_data[i][0]
	unique = string_data[i][2]
	pattern = create_unique(unique)
	toPrint = []
	j = 0
	while length > 0:
		toPrint.append(pattern[j])
		j = (j + 1) % unique
		length -= 1
	print(''.join(toPrint))


t = int(input())
for x in range(t):
	(n, a, b) = list(map(int, input().split()))
	for x in range(n):
		print(chr(97 + x % b), end='')
	print()


alphabet = 'abcdefghijklmnopqrstuvwxyz'
test_cases = int(input())
for test_case in range(test_cases):
	(n, a, b) = input().split()
	n = int(n)
	a = int(a)
	b = int(b)
	ans = ''
	while len(ans) < n:
		for i in range(b):
			if len(ans) == n:
				break
			ans += alphabet[i]
	print(ans)


t = int(input())
for i in range(t):
	l1 = list(map(int, input().split()))
	l = []
	asc = 97
	for j in range(1, l1[0] + 1):
		character = chr(asc)
		l.append(character)
		if j % l1[2] == 0:
			asc -= l1[2]
		asc += 1
	string = ''
	string = string.join(l)
	print(string)


from collections import defaultdict as dd
for _ in range(int(input())):
	(n, a, b) = map(int, input().split())
	i = 0
	r = ord('a')
	c = []
	m = b
	while b > 0:
		c.append(chr(r + i))
		i += 1
		b -= 1
	for i in range(a - m):
		c.append('a')
	ans = ''.join(c)
	for i in range(n - a):
		ans += c[i % a]
	print(ans)


for _ in range(int(input())):
	(n, a, b) = [int(x) for x in input().split()]
	for i in range(n):
		print(chr(i % b + 97), end='')
	print()


s = 'abcdefghijklmnopqrstuvwxyz'
for i in range(int(input())):
	(n, a, b) = map(int, input().split())
	temp = s[:b]
	x = n // 3
	ans = temp * (x + 1)
	ans = ans[:n]
	while len(ans) < n:
		ans = ans + temp
	print(ans[:n])


m = int(input())
while m > 0:
	(n, a, b) = map(int, input().split())
	s = 'abcdefghijklmnopqrstuvwxyz'
	ans = ''
	(q, r, d, c) = (n // a, n % a, a - b + 1, b - 1)
	while d > 0:
		ans += 'a'
		d -= 1
	ans += s[1:c + 1]
	k = ans
	q -= 1
	while q > 0:
		ans += k
		q -= 1
	if r:
		ans += ans[0:r]
	print(ans)
	m -= 1


from itertools import *
l = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
for _ in range(int(input())):
	(a, b, c) = map(int, input().split())
	x = l[:c]
	for (a, b) in zip(range(a), cycle(x)):
		print(b, end='')
	print()


t = int(input())
alphabet = 'abcdefghijklmnopqrstuvwxyz'
for i in range(t):
	(n, a, b) = [int(i) for i in input().split()]
	sub = alphabet[:b]
	k = int(n / b)
	r = n - b * k
	print(sub * k + sub[:r])


t = int(input())
for z in range(t):
	(a, b, c) = list(map(int, input().split()))
	l = 'a' * (b - c)
	stri = ''
	for i in range(c):
		stri += chr(97 + i)
	stri = stri + l
	n = ''
	for i in range(a // b + 1):
		n += stri
	n = n[0:a]
	print(n)


alph = 'qwertyuiopasdfghjklzxcvbnm'
s = ''
t = int(input())
for i in range(t):
	s1 = input().split()
	n = int(s1[0])
	a = int(s1[1])
	b = int(s1[2])
	s = n // b * alph[:b] + alph[:n % b]
	print(s)


al = list('abcdefghijklmnopqrstuvwxyz')
for _ in range(int(input())):
	(n, a, b) = map(int, input().split())
	s = al[0:b] + (a - b) * [al[0]]
	s = ''.join(s)
	s = s * n
	print(s[:n])


alphabet = 'azertyuiopqsdfghjklmwxcvbn'
for _ in range(int(input())):
	(n, a, b) = map(int, input().split())
	s = alphabet[0:b] * (n // b)
	s += alphabet[0:n % b]
	print(s)


for _ in range(int(input())):
	(n, a, b) = map(int, input().split())
	made = []
	for i in range(b):
		made.append(chr(ord('a') + i))
	for i in range(a - b):
		made.append('a')
	for i in range(n):
		print(made[i % a], end='')
	print()


from sys import stdin, gettrace
if not gettrace():

	def input():
		return next(stdin)[:-1]

def main():

	def solve():
		(n, a, b) = map(int, input().split())
		res = [chr(i % b + ord('a')) for i in range(n)]
		print(''.join(res))
	q = int(input())
	for _ in range(q):
		solve()
main()


t = int(input())
for _ in range(t):
	(n, a, b) = map(int, input().split())
	pattern = ''
	for i in range(b):
		pattern += chr(97 + i)
	while len(pattern) < a:
		pattern += 'a'
	string = pattern * (n // a) + pattern[:n % a]
	print(string)


t = int(input())
string = 'abcdefghijklmnopqrstuvwxyz'
while t > 0:
	(s, a, b) = input().split()
	(s, a, b) = (int(s), int(a), int(b))
	p = string[:b]
	k = int(s / b)
	ans = p * k
	ans += p[:s % b]
	print(ans)
	t = t - 1


for tst in range(int(input())):
	(n, a, b) = map(int, input().split())
	st = ''
	for j in range(n):
		st = st + chr(ord('a') + j % b)
	print(st)


from string import ascii_lowercase as lower

def defeat_dragon(n, a, b):
	x = lower[0:b]
	return x * (n // b) + x[0:n % b]
for _ in range(int(input())):
	(n, a, b) = map(int, input().split())
	print(defeat_dragon(n, a, b))


t = int(input())
for i in range(t):
	(n, a, b) = map(int, input().strip().split(' '))
	lst = [chr(x) for x in range(ord('a'), ord('z') + 1)]
	l = []
	for j in range(n):
		k = j % b
		l.append(lst[k])
	for j in range(n):
		print(l[j], end='')
	print()


t = int(input())
for i in range(t):
	(n, a, b) = map(int, input().split())
	unique = ''
	j = 97
	for i in range(b):
		unique += chr(j)
		j += 1
	string = ''
	while len(string) < n:
		string += unique
		if len(string) > n:
			string = string[:n]
			break
	print(string)


def main():
	for _ in inputt():
		(n, a, b) = inputi()
		s = string.ascii_lowercase[:b] + string.ascii_lowercase[b - 1] * (a - b)
		s = s * -(-n // a)
		print(s[:n])
from math import *
from heapq import *
from itertools import *
from functools import reduce, lru_cache, partial
from collections import Counter, defaultdict, deque
import re, copy, operator, cmath, string
import calendar
import sys, io, os, builtins
sys.setrecursionlimit(1000)
BUFSIZE = 8192

class FastIO(io.IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = io.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(io.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')

def print(*args, **kwargs):
	sys.stdout.write(kwargs.pop('split', ' ').join(map(str, args)))
	sys.stdout.write(kwargs.pop('end', '\n'))
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip()
inputt = lambda t=0: range(t) if t else range(int(input()))
inputs = lambda : input().split()
inputi = lambda k=int: map(k, inputs())
inputf = lambda : inputi(float)
inputl = lambda t=0, k=inputi: map(list, (k() for _ in range(t))) if t else list(k())

def len(a):
	if isinstance(a, range):
		return -((a.start - a.stop) // a.step)
	return builtins.len(a)

def bisect_left(a, x, key=None, lo=0, hi=None):
	if lo < 0:
		lo = 0
	if hi == None:
		hi = len(a)
	if key == None:
		key = do_nothing
	while lo < hi:
		mid = (lo + hi) // 2
		if key(a[mid]) < x:
			lo = mid + 1
		else:
			hi = mid
	return lo

def bisect_right(a, x, key=None, lo=0, hi=None):
	if lo < 0:
		lo = 0
	if hi == None:
		hi = len(a)
	if key == None:
		key = do_nothing
	while lo < hi:
		mid = (lo + hi) // 2
		if x < key(a[mid]):
			hi = mid
		else:
			lo = mid + 1
	return lo

def insort_left(a, x, key=None, lo=0, hi=None):
	lo = bisect_left(a, x, key, lo, hi)
	a.insert(lo, x)

def insort_right(a, x, key=None, lo=0, hi=None):
	lo = bisect_right(a, x, key, lo, hi)
	a.insert(lo, x)
do_nothing = lambda x: x
bisect = bisect_right
insort = insort_right

def index(a, x, default=None, key=None, lo=0, hi=None):
	if lo < 0:
		lo = 0
	if hi == None:
		hi = len(a)
	if key == None:
		key = do_nothing
	i = bisect_left(a, x, key, lo, hi)
	if lo <= i < hi and key(a[i]) == x:
		return a[i]
	if default != None:
		return default
	raise ValueError

def find_lt(a, x, default=None, key=None, lo=0, hi=None):
	if lo < 0:
		lo = 0
	if hi == None:
		hi = len(a)
	i = bisect_left(a, x, key, lo, hi)
	if lo < i <= hi:
		return a[i - 1]
	if default != None:
		return default
	raise ValueError

def find_le(a, x, default=None, key=None, lo=0, hi=None):
	if lo < 0:
		lo = 0
	if hi == None:
		hi = len(a)
	i = bisect_right(a, x, key, lo, hi)
	if lo < i <= hi:
		return a[i - 1]
	if default != None:
		return default
	raise ValueError

def find_gt(a, x, default=None, key=None, lo=0, hi=None):
	if lo < 0:
		lo = 0
	if hi == None:
		hi = len(a)
	i = bisect_right(a, x, key, lo, hi)
	if lo <= i < hi:
		return a[i]
	if default != None:
		return default
	raise ValueError

def find_ge(a, x, default=None, key=None, lo=0, hi=None):
	if lo < 0:
		lo = 0
	if hi == None:
		hi = len(a)
	i = bisect_left(a, x, key, lo, hi)
	if lo <= i < hi:
		return a[i]
	if default != None:
		return default
	raise ValueError
main()


from collections import deque, defaultdict, Counter
from bisect import bisect_left, bisect
import math

def solve(inf):
	ans = []
	(n, a, b) = inf
	alp = 'abcdefghijklmnopqrstuvwxyz'
	req = alp[:b]
	ans = req * int(math.ceil(n / b))
	return ans[:n]
for _ in range(int(input())):
	inf = list(map(int, input().split()))
	print(solve(inf))


sep = 'qwertyuiopasdfghjklzxcvbnm'
s = ''
n = int(input())
for i in range(n):
	ans = ''
	(a, b, c) = map(int, input().split())
	while a > c:
		ans += sep[0:c]
		a -= c
	if a > 0:
		ans += sep[0:a]
	print(ans)


T = int(input())
i = 0
while i < T:
	i += 1
	(n, a, b) = [int(k) for k in input().split()]
	temp = ''
	result = ''
	for j in range(b):
		temp += chr(ord('a') + j)
		if len(temp) == n % b:
			temp2 = temp
	while len(result) <= n - b:
		result += temp
	if n % b != 0:
		result += temp2
	print(result)


alpha = [chr(i) for i in range(ord('a'), ord('z') + 1)]
for i in range(int(input())):
	(n, a, b) = map(int, input().split())
	li = []
	for _ in range(a):
		if b > 0:
			b -= 1
		li.append(alpha[b])
	for _ in range(n):
		print(li[_ % a], end='')
	print()


testcases = int(input())
for _ in range(testcases):
	(n, a, b) = map(int, input().strip().split())
	ans = ''
	alpha = 'a'
	test_list = []
	for i in range(0, 26):
		test_list.append(alpha)
		alpha = chr(ord(alpha) + 1)
	i = 0
	tempb = b
	while b > 0:
		ans += test_list[i]
		i += 1
		b -= 1
	x = n // tempb - 1
	f_ans = ans
	while x > 0:
		f_ans += ans
		x -= 1
	x = n - len(f_ans)
	j = 0
	while x > 0:
		f_ans += ans[j]
		j += 1
		x -= 1
	print(f_ans)


t = int(input())
for tt in range(t):
	nab = input().split()
	n = int(nab[0])
	a = int(nab[1])
	b = int(nab[2])
	ans = ''
	tmp = 'a'
	for i in range(b):
		ans += tmp
		tmp = chr(ord(tmp) + 1)
	for i in range(a - b):
		ans += ans[-1]
	copy = ans
	for i in range(n - a):
		ans += copy[i % a]
	print(ans)


def main():
	t = int(input())
	li = list(map(chr, range(97, 123)))
	while t:
		t = t - 1
		(n, a, b) = map(int, input().strip().split())
		subli = li[:b]
		st = []
		for i in range(int(n / b)):
			st.append(''.join(subli))
		st.append(''.join(subli[:n % b]))
		st = ''.join(st)
		print(st)
main()


T = int(input())
for i in range(T):
	(a, b, c) = map(int, input().split())
	r = ''
	e = 97
	for i in range(c):
		r = r + chr(e)
		e = e + 1
	mo = a % c
	di = a // c
	ans = r * di + r[:mo]
	print(ans)


def sting(n, a, b):
	let = 'abcdefghijklmnopqrstuvwxyz'
	bst = let[:b]
	tast = bst * (a // b + 1)
	ast = tast[:a]
	tnst = ast * (n // a + 1)
	nst = tnst[:n]
	return nst
t = int(input())
while t > 0:
	(n, a, b) = map(int, input().split())
	print(sting(n, a, b))
	t -= 1


T = int(input())
t = 0
while t < T:
	nab = list(map(int, input().split()))
	N = nab[0]
	A = nab[1]
	B = nab[2]
	alf = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
	s = ''
	x = 0
	while len(s) < N:
		if x == B:
			x = 0
		s += alf[x]
		x += 1
	print(s)
	t += 1


string = 'abcdefghijklmnopqrstuvwxyz'
for _ in range(int(input())):
	(n, a, b) = map(int, input().split())
	bharajasaktahai = int(a / b + 0.99999999)
	temp = string[0:b] * bharajasaktahai
	b = len(temp)
	a = n
	bharajasaktahai = int(a / b + 0.99999999)
	print((temp * bharajasaktahai)[0:n])


let = 'abcdefghijklmnopqrstuvwxyz'
t = int(input())
for i in range(0, t):
	(n, a, b) = input().split(' ')
	n = int(n)
	a = int(a)
	b = int(b)
	if a == b:
		l = let[:b]
		dev = l * (n // a + 1)
		dev = dev[:n]
		print(dev)
		continue
	elif b == 1:
		print(n * 'a')
		continue
	else:
		subb = let[:b]
		r = a // b
		dev = ''
		for i in range(0, r + 2):
			if i % 2 == 0:
				dev = dev + subb
			else:
				dev = dev + subb[::-1]
		dev = dev[:a]
		m = n // a
		dev = dev * (m + 1)
		dev = dev[:n]
		print(dev)


for i in range(int(input())):
	(n, m, k) = map(int, input().split())
	s = 'abcdefghijklmnopqrstuvwxyz'
	x = n // k
	y = n % k
	print(s[:k] * x + s[:y])


t = int(input())
text = 'qwertyuiopasdfghjklzxcvbnm'
for i in range(0, t):
	y = input().split()
	n = int(y[0])
	a = int(y[1])
	b = int(y[2])
	need = text[0:b]
	op = need
	rest = n - len(op)
	while rest / len(need) > 1:
		op += need
		rest = n - len(op)
	if rest > 0:
		op += need[0:rest]
	print(op)


t = int(input())
while t > 0:
	(n, a, b) = input().split(' ')
	n = int(n)
	b = int(b)
	k = 97
	s = ''
	for i in range(b):
		s = s + chr(k)
		k += 1
	idx = 0
	for i in range(n - b):
		s += s[idx]
		idx += 1
	print(s)
	t -= 1


t = int(input())
from string import ascii_lowercase
letters = ascii_lowercase
while t > 0:
	(n, a, b) = map(int, input().split(' '))
	s = letters[:b - 1] + letters[b - 1] * (a - (b - 1))
	res = s * (n // len(s) + 1)
	res = res[:n]
	print(res)
	t -= 1


import sys
sys.setrecursionlimit(10 ** 6)
int1 = lambda x: int(x) - 1
p2D = lambda x: print(*x, sep='\n')

def II():
	return int(sys.stdin.readline())

def MI():
	return map(int, sys.stdin.readline().split())

def LI():
	return list(map(int, sys.stdin.readline().split()))

def LLI(rows_number):
	return [LI() for _ in range(rows_number)]

def SI():
	return sys.stdin.readline()[:-1]

def main():
	for _ in range(II()):
		(n, a, b) = MI()
		s = ''
		for i in range(b):
			s += chr(97 + i)
		s += s[-1] * (a - b)
		(c, r) = divmod(n, a)
		print(s * c + s[:r])
main()


for _ in range(int(input())):
	(n, a, b) = map(int, input().split())
	s = ''
	if b == 1:
		s = a * 'a'
	else:
		for i in range(b - 1):
			s += chr(97 + i)
		s += (a - b + 1) * chr(97 + b - 1)
	k = n // a
	s1 = s * k
	if n - k * a:
		s1 += s[:n - k * a]
	print(s1)


for t in range(int(input())):
	(n, a, b) = list(map(int, input().split()))
	res = ''
	c = 0
	for i in range(n):
		if c == b or c + 97 == 123:
			c = 0
		res += chr(c + 97)
		c += 1
	print(res)


for _ in range(int(input())):
	count = 97
	(n, a, b) = input().split()
	n = int(n)
	a = int(a)
	b = int(b)
	s = ''
	b = 97 + b
	for i in range(n):
		s += chr(count)
		count += 1
		if count == b:
			count = 97
	print(s)
ord('z')


import string
alpha = string.ascii_lowercase
t = int(input())
for _ in range(t):
	(n, a, b) = [int(x) for x in input().split()]
	pointer = 0
	s = ''
	while len(s) < n:
		s += alpha[pointer % b]
		pointer += 1
	print(s)


test = int(input())
for t in range(test):
	(N, A, B) = map(int, input().split())
	list = ['q', 'w', 'e', 'r', 't', 'y', 'u', 'i', 'o', 'p', 'a', 's', 'd', 'f', 'g', 'h', 'j', 'k', 'l', 'z', 'x', 'c', 'v', 'b', 'n', 'm']
	while N:
		for b in range(min(B, N)):
			print(list[b], end='')
			N -= 1
	print('\n')


nbT = int(input())
import sys
import string
alphabet = list(string.ascii_lowercase)
for i in range(nbT):
	word = ''
	(n, a, b) = list(map(int, input().split()))
	while len(word) < n:
		for k in range(b):
			if len(word) < n:
				word += alphabet[k]
			if len(word) == n:
				break
	print(word)


alphabet = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
answers = []

def construct_string(n, a, b):
	symbols = alphabet[:b]
	finish_marker = False
	s = 'a' * n
	for i in range(n - a + 1):
		if finish_marker:
			switch_counter = 1
			for k in range(len(symbols)):
				if not symbols[k] in s[i:a + i]:
					s = s[:i + a - switch_counter] + symbols[k] + s[i + a - switch_counter + 1:]
		else:
			for k in range(len(symbols)):
				if not symbols[k] in s[i:a + i]:
					s = s[:k + i] + symbols[k] + s[k + i + 1:]
		finish_marker = True
	return s
t = int(input())
for index_t in range(t):
	input_s = input().split(' ')
	n = int(input_s[0])
	a = int(input_s[1])
	b = int(input_s[2])
	answers.append(construct_string(n, a, b))
for i in range(t):
	print(answers[i])


t = int(input())
for you in range(t):
	l = input().split()
	n = int(l[0])
	a = int(l[1])
	b = int(l[2])
	for i in range(n):
		print(chr(97 + i % b), end='')
	print()


for t in range(int(input())):
	(n, a, b) = map(int, input().split())
	s = [0] * n
	(f, x) = (97, 0)
	if a != 1 and b == 1:
		for i in range(len(s)):
			s[i] = chr(f)
	elif a == b:
		for i in range(len(s)):
			if x >= 26:
				x = 0
			s[i] = chr(f + x)
			x += 1
	else:
		for i in range(len(s)):
			if x >= b:
				x = 0
			s[i] = chr(f + x)
			x += 1
	for i in range(len(s)):
		print(s[i], end='')
	print()


check = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
t = int(input())
for i in range(t):
	(n, a, b) = [int(x) for x in input().split()]
	ind = 0
	s = ''
	if b == 1:
		s = n * check[0]
	while len(s) < n:
		while ind != b - 1:
			if len(s) == n:
				break
			s += check[ind]
			ind += 1
		while len(s) % a != 0:
			if len(s) == n:
				break
			s += check[ind]
		ind = 0
	print(s)


t = int(input())
for i in range(t):
	z = [int(x) for x in input().split()]
	alpha = 'abcdefghijklmnopqrstuvwxyz'
	n = z[0]
	a = z[1]
	b = z[2]
	div = int(n / b)
	rem = n % b
	answer = ''
	for j in range(div):
		for i in range(b):
			answer += alpha[i]
	for i in range(rem):
		answer += alpha[i]
	print(answer)


for _ in range(int(input())):
	(n, a, b) = map(int, input().split())
	s = ''
	ch = 'a'
	for i in range(b):
		s += ch
		o = ord(ch) + 1
		ch = chr(o)
	z = s
	x = a - b
	q = x // b
	for i in range(q):
		s += z
	s += z[:x % b]
	q = n // a
	for i in range(q):
		print(s, end='')
	q = n % a
	print(s[:q])


import string
alphabet_string = string.ascii_lowercase
arr = list(alphabet_string)
t = int(input())
for _ in range(t):
	(n, a, b) = map(int, input().split())
	ans = ''
	distinct = 0
	sub_length = 0
	total_num = 0
	while total_num < n:
		while sub_length < a:
			total_num += 1
			if total_num > n:
				break
			if distinct >= b:
				distinct = 0
			ans += arr[distinct]
			distinct += 1
			sub_length += 1
		sub_length = 0
		distinct = 0
	print(ans)


letters = list('abcdefghijklmnopqrstuvwxyz')
for _ in range(int(input())):
	line = list(map(int, input().split()))
	(n, a, b) = (line[0], line[1], line[2])
	new_string = []
	under_string = []
	new_alphabet = []
	for i in range(b):
		new_alphabet.append(letters[i])
	for j in range(a):
		if j < len(new_alphabet):
			under_string.append(new_alphabet[j])
		else:
			under_string.append(new_alphabet[j % len(new_alphabet)])
	for k in range(n):
		new_string.append(under_string[k % len(under_string)])
	print(''.join(new_string))


import collections

def calc(n, a, b):
	base = []
	curr = 'a'
	for i in range(b):
		base.append(curr)
		curr = chr(ord(curr) + 1)
	for i in range(a - b):
		base.append('a')
	for i in range(n - a):
		base.append(base[-a])
	return ''.join(base)
N = int(input())
cases = []
for _ in range(N):
	cases.append(map(int, input().split()))
for (n, a, b) in cases:
	print(calc(n, a, b))


import sys

class BConstructTheString:

	def solve(self):
		for _ in range(int(input())):
			(n, a, b) = [int(_) for _ in input().split()]
			p = ''.join((chr(x) for x in range(ord('a'), ord('a') + b)))
			ans = p * (n // b + 1)
			print(ans[:n])
solver = BConstructTheString()
input = sys.stdin.readline
solver.solve()


from sys import stdin, stdout
t = int(stdin.readline())
while t > 0:
	(n, a, b) = map(int, stdin.readline().split())
	local = {}
	s = ''
	d = -1
	alp = 'abcdefghijklmnopqrstuvwxyz'
	for i in range(a):
		if len(local) < b:
			d += 1
			d %= 26
		s += alp[d]
		if alp[d] not in local:
			local[alp[d]] = 1
		else:
			local[alp[d]] += 1
	for i in range(a, n):
		local[s[i - a]] -= 1
		if local[s[i - a]] == 0:
			del local[s[i - a]]
		if len(local) < b:
			d += 1
			d %= 26
		s += alp[d]
		if alp[d] not in local:
			local[alp[d]] = 1
		else:
			local[alp[d]] += 1
	stdout.write('{}\n'.format(s))
	t -= 1


import math
t = int(input())
for i in range(t):
	(a, b, c) = map(int, input().split())
	s = ''
	for i in range(c):
		s += chr(97 + i)
	while len(s) < a:
		s += s
	print(s[:a])


t = int(input())
s = 'azertyuiopmlkjhgfdsqwxcvbn'
for j in range(t):
	liste = list(map(int, input().split()))
	l = []
	i = 0
	while len(l) < liste[0]:
		l.append(s[i % liste[2]])
		i += 1
	print(''.join(l))


import sys
input = sys.stdin.readline
INF = float('inf')
mod = 10 ** 9 + 7
eps = 10 ** (-7)

def inp():
	return int(input())

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

def inpl_str():
	return list(input().split())
t = inp()
for _ in range(t):
	(n, a, b) = inpl()
	ans = ''
	tmp = 0
	for i in range(n):
		ans += chr(97 + tmp)
		tmp = (tmp + 1) % b
	print(ans)


t = int(input())
for i in range(t):
	(n, a, b) = list(map(int, input().split()))
	alpha = 'abcdefghijklmnopqrstuvwxyz'
	res = ''
	j = -1
	distinct = 0
	for i in range(n):
		if i < a:
			if distinct < b:
				j += 1
				res += alpha[j]
				distinct += 1
			else:
				res += alpha[j]
		elif i >= a:
			res += res[i - a]
	print(res)


for _ in range(int(input())):
	(n, a, b) = map(int, input().split())
	s = 'a' * n
	s = list(s)
	i = 0
	ch = 'b'
	while i < len(s):
		flag = 1
		for j in range(b - 1):
			if i + j >= len(s):
				flag = 0
				break
			s[i + j] = ch
			if ch == 'z':
				ch = 'a'
			ch = chr(ord(ch) + 1)
		i = i + a
		if flag == 0:
			break
	print(''.join(s))


n = int(input())
for i in range(0, n):
	o = input().rstrip().split(' ')
	n = int(o[0])
	a = int(o[1])
	b = int(o[2])
	A = 0
	l = []
	for j in range(0, b):
		l.append(chr(A % 26 + 97))
		A += 1
	for j in range(0, n):
		print(l[j % len(l)], end='')
	print()


T = int(input())
for _ in range(T):
	(n, a, b) = map(int, input().split())
	letters = list(map(chr, range(97, 97 + 26)))
	rep = ''
	for i in range(b):
		rep += letters[i]
	temp = rep * 2000
	ans = temp[:n]
	print(ans)


from math import ceil
alphabet = 'abcdefghijklmnopqrstuvwxyz'
for _ in range(int(input())):
	(n, a, b) = map(int, input().split())
	r = alphabet[:b]
	if b < 26:
		r += r[-1] * (a - b)
	r = r * ceil(n / len(r))
	print(r[:n])


import string
t = int(input())
for _ in range(t):
	(a, n, b) = map(int, input().split())
	prefix = string.ascii_lowercase[:b]
	suffix = prefix[0] * (n - b)
	ans = ''
	while len(ans) < a:
		ans += prefix + suffix
	print(ans[:a])


t = int(input())
for _ in range(t):
	(n, a, b) = map(int, input().split())
	s = [0] * n
	d = dict()
	st = 'qwertyuiopasdfghjklzxcvbnm'
	j = 0
	for i in range(a):
		if b > 0:
			d[i] = st[j]
			b -= 1
			j += 1
		else:
			d[i] = d[i - 1]
	for i in range(n):
		s[i] = d[i % a]
	print(''.join(s))


import sys
t = int(sys.stdin.readline())
k = 1
while k <= t:
	arr = sys.stdin.readline().strip().split()
	(n, a, b) = list(map(int, arr))
	output = [None] * n
	char_list = list(map(chr, range(ord('a'), ord('z') + 1)))
	c_count = {}
	for c in char_list[:b]:
		c_count[c] = 1
	i = 0
	while i < b:
		output[i] = char_list[i]
		i = i + 1
	while i < a:
		output[i] = char_list[0]
		i = i + 1
	p = 0
	while i < n:
		output[i] = output[p]
		p = p + 1
		i = i + 1
	output = ''.join(output)
	print(output)
	k = k + 1


Test = int(input())
while Test > 0:
	(n, a, b) = map(int, input().split())
	for i in range(n):
		print(chr(ord('a') + i % b), end='')
	Test -= 1
	print()


T = int(input())
l = 'qwertyuiopasdfghjklzxcvbnm'
for case in range(T):
	(n, a, b) = map(int, input().split())
	sub = l[0] * (a - b) + l[:b]
	ans = n // a * sub + sub[:n % a]
	print(ans)


import sys
sys.setrecursionlimit(10 ** 7)
stdin = sys.stdin
ni = lambda : int(ns())
na = lambda : list(map(int, stdin.readline().split()))
ns = lambda : stdin.readline().rstrip()
li = [chr(ord('a') + i) for i in range(26)]
t = ni()
for i in range(t):
	(n, a, b) = na()
	if b == a:
		v = ''.join(li[:n])
		for i in range(n // 26):
			print(v, end='')
		print(v[:n % 26])
	else:
		tmp = ['a' for i in range(a - b + 1)]
		for i in range(b - 1):
			tmp.append(li[i + 1])
		v = ''.join(tmp)
		for i in range(n // a):
			print(v, end='')
		print(v[:n % a])


from sys import stdin, stdout

def f(n, a, b):
	ans = ''
	ans2 = ''
	for i in range(b):
		ans += chr(i + 97)
	for i in range(int(n / b)):
		ans2 += ans
	for i in range(n % b):
		ans2 += chr(i + 97)
	print(ans2)
t = int(stdin.readline())
for _ in range(t):
	(n, a, b) = list(map(int, stdin.readline().split()))
	f(n, a, b)


def letter(n):
	letters = list('qwertyuiopasdfghjklzxcvbnm')
	return letters[n % 26]
t = int(input())
while t > 0:
	(n, a, b) = input().split()
	n = int(n)
	a = int(a)
	b = int(b)
	letter_list = list(letter(0) * n)
	for i in range(0, n):
		letter_list[i] = letter(i % b)
	print(''.join(letter_list))
	t -= 1


oa = ord('a')
for t in range(int(input())):
	(n, a, b) = map(int, input().split())
	cl1 = [chr(c) for c in range(oa, oa + b)]
	cl2 = ['a' for c in range(b + 1, a)]
	(cl1, cl2) = (cl1 + cl2, [])
	while len(cl2) < n:
		cl2 += cl1
	print(*cl2[:n], sep='')


t = int(input())
for _ in range(t):
	(n, a, b) = map(int, input().split())
	s = ''
	for i in range(0, b):
		s += chr(97 + i)
	for i in range(b, a):
		s += s[-1]
	x = 0
	res = ''
	while x < n:
		res += s
		x += a
	print(res[:n])


import io, os
input = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline
import sys

def solve(n, a, b):
	A = 'abcdefghijklmnopqrstuvwxyz'
	ans = A[:b]
	ans += 'a' * (a - b)
	for i in range(n - a):
		ans += ans[i]
	return ans

def main():
	t = int(input())
	for t in range(t):
		(n, a, b) = map(int, input().split())
		ans = solve(n, a, b)
		sys.stdout.write(ans + '\n')
main()


import sys
from sys import stdin, stdout
import math
import random
import heapq
from collections import Counter
from functools import lru_cache
try:
	for _ in range(int(input())):
		(n, a, b) = map(int, input().split())
		print(('abcdefghijklmnopqrstuvwxyz'[:b] * n)[:n])
except EOFError as e:
	print(e)


alpha = 'abcdefghijklmnopqrstuvwxyz'
t = int(input())
for _ in range(t):
	(n, a, b) = list(map(int, input().split()))
	s = alpha[:b]
	while b < a:
		b += b
		s += s
	s = s[:a]
	while a < n:
		a += a
		s += s
	print(s[:n])


for i in range(int(input())):
	(n, a, b) = map(int, input().split())
	s = ''
	t = 0
	while len(s) < n:
		g = a - b + 1
		for i in range(a):
			if g != 0:
				g -= 1
				s += 'a'
			else:
				s += chr(ord('b') + t)
				t += 1
				if ord('b') + t == 123:
					t = 0
			if len(s) == n:
				break
	print(s)


import sys
import string
from collections import defaultdict as dd
from collections import deque
import bisect
import heapq

def ri():
	return int(input())

def rl():
	return list(map(int, input().split()))
t = ri()
for _ in range(t):
	(n, a, b) = rl()
	s = ''
	alphabet = string.ascii_lowercase[:b]
	sa = alphabet + 'a' * (a - b)
	q = n // a
	r = n % a
	s = sa * q + sa[:r]
	print(s)


t = int(input())
for _ in range(t):
	(n, a, b) = tuple(map(int, input().split()))
	letter = 'a'
	alphabet = 'bcdefghijklmnopqrstuvwxyz'
	res = []
	while len(res) <= 2000:
		res.extend([letter] * (a - b + 1))
		res.extend(alphabet[:b - 1])
	print(''.join(res[:n]))


def dfs(index, ans, visited, a, length):
	visited[index] = True
	if len(ans[index]) == 1:
		length[index] = a
	for i in range(len(ans[index])):
		if visited[ans[index][i]] == False:
			dfs(ans[index][i], ans, visited, a + 1, length)

def solve():
	n = list(map(int, input().split(' ')))
	for i in range(n[0]):
		print(chr(ord('a') + i % n[2]), end='')
	print()
t = input().split()
t = int(t[0])
for _ in range(t):
	solve()


from sys import stdin, stdout
input = stdin.readline
print = stdout.write
for _ in range(int(input())):
	(n, m, x) = map(int, input().split())
	ans = []
	for i in range(97, 97 + x):
		ans.append(chr(i))
	ans *= n // x + 1
	for i in range(n):
		print(ans[i])
	print('\n')


t = int(input())
for _ in range(t):
	(n, a, b) = map(int, input().split())
	s = ''
	for i in range(b):
		s = s + chr(ord('a') + i)
	i = (n - b) // b
	k = s
	while i > 0:
		s = s + k
		i = i - 1
	if n == len(s):
		print(s)
	else:
		x = n - len(s)
		print(s + k[:x])


import sys
from random import choice, randint
inp = sys.stdin.readline
out = sys.stdout.write
flsh = sys.stdout.flush
sys.setrecursionlimit(10 ** 9)
inf = 10 ** 20
eps = 1.0 / 10 ** 10
mod = 10 ** 9 + 7
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]

def MI():
	return map(int, inp().strip().split())

def LI():
	return list(map(int, inp().strip().split()))

def LLI():
	return [list(map(int, l.split())) for l in sys.stdin.readlines().strip()]

def LI_():
	return [int(x) - 1 for x in inp().strip().split()]

def LF():
	return [float(x) for x in inp().strip().split()]

def LS():
	return inp().strip().split()

def I():
	return int(inp().strip())

def F():
	return float(inp().strip())

def S():
	return inp().strip()

def pf(s):
	return out(s + '\n')

def JA(a, sep):
	return sep.join(map(str, a))

def JAA(a, s, t):
	return s.join((t.join(map(str, b)) for b in a))

def main():
	t = I()
	l = []
	for _ in range(t):
		(n, a, b) = MI()
		s = 'abcdefghijklmnopqrstuvwxyz'
		sub = s[:b]
		(q, r) = (n // b, n % b)
		ans = sub * q + sub[:r]
		print(ans)
main()


t = int(input())
for i in range(t):
	(n, a, b) = map(int, input().split())
	ans = [''] * n
	for j in range(a - b):
		ans[j] = 'a'
	for j in range(a - b, a):
		ans[j] = chr(ord('a') + j - a + b)
	for j in range(a, n):
		ans[j] = ans[j - a]
	print(''.join(ans))


from math import ceil
text = 'abcdefghijklmnopqrstuvwxyz'
for i in range(int(input())):
	(n, a, b) = [int(n) for n in input().split()]
	tx = text[:b]
	tx = tx * ceil(n / b)
	print(tx[:n])


import os
import sys
from io import BytesIO, IOBase
from string import ascii_lowercase

def solution(n, a, b):
	rep = ascii_lowercase[:b]
	res = rep * (n // b) + rep[:n % b]
	print(res)

def main():
	for _ in range(r_int()):
		(n, a, b) = r_array()
		solution(n, a, b)
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 write(*args, end='\n'):
	for x in args:
		sys.stdout.write(str(x) + ' ')
	sys.stdout.write(end)

def r_array():
	return [int(x) for x in input().split()]

def r_int():
	return int(input())
main()


from math import *
t = int(input())
output = []
for _ in range(t):
	(n, a, b) = list(map(int, input().split()))
	al = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
	s = ''
	prevs = ''
	for i in range(b):
		prevs += al[i]
	for i in range(a - b):
		prevs += prevs[b - 1]
		print()
	s = prevs
	for i in range(n - a):
		s += s[len(s) - a]
	output.append(s)
for i in output:
	print(i)


import string
lower = string.ascii_lowercase
T = int(input())
for t in range(T):
	(n, a, b) = [int(i) for i in input().split()]
	char_to_use = lower[:b]
	print(char_to_use * (n // b) + lower[:n % b])


import math
t = int(input())
for _ in range(t):
	(n, a, b) = map(int, input().split())
	st = ''
	s = 'abcdefghijklmnopqrstuvwxyz'
	d = {}
	last = ''
	for i in range(n // a):
		temp = 0
		for j in range(a):
			if temp < b:
				st += s[j]
				d[s[j]] = 1
				last = s[j]
				temp += 1
			else:
				st += last
	for i in range(n % a):
		st += st[i]
	print(st)


test = int(input())
for _ in range(test):
	(n, a, b) = [int(x) for x in input().split()]
	arr = [chr(index % b + ord('a')) for index in range(n)]
	for item in arr:
		print(item, end='')
	print()


alpha = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
for _ in range(int(input())):
	(n, a, b) = map(int, input().split())
	let = alpha[0:b]
	string = []
	index = 0
	for i in range(n):
		string.append(let[index])
		index += 1
		if index >= b:
			index = 0
	print(''.join(string))


for _ in range(int(input())):
	(n, a, b) = map(int, input().split())
	s = ''
	for i in range(b):
		s += str(chr(ord('a') + i))
	st = s
	while len(s) <= n:
		s += st
	s = s[:n]
	print(s)


dp = [[999999999999] * 100 for i in range(100)]
t = int(input())
for i in range(t):
	(n, a, b) = list(map(int, input().split()))
	ans = ''
	cur = [i % b for i in range(a)]
	pos = a
	while pos < n:
		a = cur.pop(0)
		ans += chr(a + 97)
		cur.append(a)
		pos += 1
	ans += ''.join(list(map(lambda x: chr(x + 97), cur)))
	print(ans)


import sys
import math
from collections import Counter
debug = 1
readln = sys.stdin.readline

def readint():
	return int(readln().strip())

def readints():
	return map(int, readln().split())

def readstr():
	return readln().strip()

def readstrs():
	return readln().split()

def dbg(*args):
	if debug:
		print(' '.join(map(str, args)))

def solve(n, a, b):
	latins = list('abcdefghijklmnopqrstuvwxyz')
	ans = []
	for i in range(n):
		ans.append(latins[i % b])
	return ''.join(ans)
t = readint()
for _ in range(t):
	(n, a, b) = readints()
	print(solve(n, a, b))


q = int(input())
s = sorted(list('qwertyuiopasdfghjkzxcvbnml'))
for t in range(q):
	(n, a, b) = map(int, input().split())
	tmp = 'a' * (a - b + 1)
	for i in range(1, b):
		tmp += s[i]
	print(tmp * (n // a) + tmp[:n % a])


import sys

def main():
	test_cases = int(sys.stdin.readline())
	for i in range(test_cases):
		input = sys.stdin.readline().split()
		n = int(input[0])
		a = int(input[1])
		b = int(input[2])
		substring = ''
		for i in range(b):
			substring += chr(97 + i)
		output = substring * int(n / b)
		output += substring[:n % b]
		print(output)
main()


def solve():
	(n, a, b) = map(int, input().split())
	cycle = list(range(ord('a'), ord('a') + b))
	n_cycles = (n - 1) // b + 1
	pre_str = cycle * n_cycles
	print(''.join(map(chr, pre_str[:n])))
t = int(input())
for _ in range(t):
	solve()


t = int(input())
while t > 0:
	(x, y, z) = input().split()
	x = int(x)
	y = int(y)
	z = int(z)
	k = 0
	l = []
	for i in range(0, z):
		l.append(chr(97 + i))
	for j in range(z + 1, x + 1):
		l.append(l[k])
		k = k + 1
	str1 = ''
	print(str1.join(l))
	t = t - 1


t = int(input())
while t > 0:
	(n, a, b) = [int(i) for i in input().split()]
	s = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
	temp = ''.join(s[:b])
	div = n // b
	t1 = 0
	if n % b == 0:
		print(temp * div)
	else:
		k = n % b
		t1 = ''.join(s[:k])
		print(temp * div + t1)
	t -= 1


t = int(input())
al = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
for i in range(t):
	(n, a, b) = map(int, input().split())
	ls = []
	s = ''
	b = min(b, 26)
	for j in range(b):
		ls.append(al[j])
	for j in range(n):
		s = s + ls[j % b]
	print(s)


times = int(input())
answers = []
chars = 'abcdefghijklmnopqrstuvwxyz'
for time in range(times):
	inputList = list(map(int, input().split()))
	n = inputList[0]
	a = inputList[1]
	b = inputList[2]
	stringFinalized = ''
	substring = chars[:b]
	while len(stringFinalized) < n:
		missingLetters = n - len(stringFinalized)
		if missingLetters > b:
			stringFinalized += substring
		else:
			stringFinalized += substring[:missingLetters]
	answers.append(stringFinalized)
for i in range(len(answers)):
	print(answers[i])


TC = int(input())
for _ in range(TC):
	(n, a, b) = map(int, input().split())
	if a == b:
		substr = ''.join([chr(x) for x in range(97, 97 + b)])
	else:
		substr = ''.join([chr(x) for x in range(97, 97 + b)]) + chr(97 + b - 1) * (b - a)
	print((substr * 2000)[:n])


for _ in range(int(input())):
	(a, b, c) = map(int, input().split())
	x = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
	h = [] * c
	for i in range(c):
		h.append(x[i])
	x = [] * a
	p = a // c
	p1 = a % c
	x = h * p
	for e1 in range(p1):
		x.append(h[e1])
	li = ''.join(map(str, x))
	li.strip()
	print(li)


t = int(input())
for _ in range(t):
	(n, m, k) = map(int, input().split())
	s = ''
	cp = 0
	i = 0
	while n > 0:
		if i <= k - 1 and n > 0:
			print(chr(97 + i), end='')
			i += 1
			n -= 1
			continue
		if m > k and cp == 0:
			for _ in range(m - k):
				if n > 0:
					print(chr(96 + i), end='')
					n -= 1
			cp = 1
		if n > 0:
			i = 0
			cp = 0
			continue
		else:
			break
	print()


t = int(input())
count = 0
l = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
while count < t:
	count += 1
	l1 = list(map(int, input().split(' ')))
	n = l1[0]
	a = l1[1]
	b = l1[2]
	ans = ''
	index = 0
	while index < b:
		ans += l[index]
		index += 1
	ans += (a - b) * l[index - 1]
	while len(ans) < n:
		ans = 2 * ans
	print(ans[:n])


def construct(n):
	i = 97
	string = ''
	while i - 97 < n:
		string = string + chr(i)
		i += 1
	return string
t = int(input())
i = 0
while i < t:
	s = input().split()
	n = int(s[0])
	a = int(s[1])
	b = int(s[2])
	ans = construct(b) * int(n / b)
	ans = ans + construct(n % b)
	print(ans)
	i += 1


for i in range(int(input())):
	print('\n')
	(n, a, b) = map(int, input().split())
	c = 0
	j = 0
	while j < b:
		c += 1
		print(chr(97 + j), end='')
		if c == n:
			break
		elif c < n and j == b - 1:
			j = 0
		else:
			j += 1


from math import ceil
t = int(input())
ans = []
alph = 'abcdefghijklmnopqrstuvwxyz'
for i in range(t):
	(n, a, b) = [int(val) for val in input().split()]
	res = (alph[:b] * ceil(n / b))[:n]
	ans.append(res)
print(*ans, sep='\n')


import string

def foo():
	(n, a, b) = map(int, input().split())
	lis = string.ascii_lowercase
	cycle = lis[:b]
	ans = ''
	for i in range(n):
		ans += cycle[i % b]
	print(ans)
t = int(input())
for i in range(t):
	foo()


for T in range(int(input())):
	(n, a, b) = map(int, input().split())
	ans = 'a'
	t = ord('a')
	for i in range(b - 1):
		t += 1
		ans += chr(t)
	for i in range(a - b):
		ans += chr(t)
	i = 0
	k = len(ans)
	while len(ans) != n:
		ans += ans[i]
		i += 1
		i = i % k
	print(ans)


import sys
import os
from io import IOBase, BytesIO
import math
import collections
mod = 10 ** 9 + 7
pie = 3.1415926536

def modinv(n, p):
	return pow(n, p - 2, p)

def ncr(n, r, p):
	t = fact[n] * (ifact[r] * ifact[n - r] % p) % p
	return t

def ain():
	return list(map(int, sin().split()))

def sin():
	return input().strip()

def GCD(x, y):
	while y:
		(x, y) = (y, x % y)
	return x

def read2DIntArray(row, col):
	arr = []
	for i in range(0, row):
		temp = list(map(int, sin().split()))
		arr.append(temp)
	return arr

def read2DCharArray(row, col):
	arr = []
	for i in range(0, row):
		temp = str(sin())
		arr.append(temp)
	return arr

def smallestNumber(n):
	lst = list(str(n))
	lst.sort()
	tmp = ''
	for (i, n) in enumerate(lst):
		if n != '0':
			tmp = lst.pop(i)
			break
	return str(tmp) + ''.join(lst)

def SieveOfEratosthenes(n):
	prime = [True for i in range(n + 1)]
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * 2, n + 1, p):
				prime[i] = False
		p += 1
	prime[0] = False
	prime[1] = False
	lst = []
	for p in range(n + 1):
		if prime[p]:
			lst.append(p)
	return lst

def nCr(n, r):
	a = 1
	b = 1
	c = 1
	for i in range(1, n + 1):
		c *= i
	for i in range(1, r + 1):
		b *= i
	for i in range(1, n - r + 1):
		a *= i
	return c // (a * b)

def sieveOfEratosthenes1(N, s):
	prime = [False] * (N + 1)
	for i in range(2, N + 1, 2):
		s[i] = 2
	for i in range(3, N + 1, 2):
		if prime[i] == False:
			s[i] = i
			for j in range(i, int(N / i) + 1, 2):
				if prime[i * j] == False:
					prime[i * j] = True
					s[i * j] = i

def generatePrimeFactors(N):
	s = [0] * (N + 1)
	sieveOfEratosthenes1(N, s)
	curr = s[N]
	cnt = 1
	factors = []
	power = []
	while N > 1:
		N //= s[N]
		if curr == s[N]:
			cnt += 1
			continue
		factors.append(curr)
		power.append(cnt)
		curr = s[N]
		cnt = 1
	return (factors, power)

def main():
	for _ in range(int(sin())):
		(n, a, b) = map(int, sin().split())
		lst = []
		for i in range(b):
			lst.append(chr(97 + i))
		m = len(lst)
		ans = ''
		for i in range(n):
			ans += lst[i % m]
		print(ans)
py2 = round(0.5)
if py2:
	from future_builtins import ascii, filter, hex, map, oct, zip
	range = xrange
BUFSIZE = 8192

class FastIO(BytesIO):
	newlines = 0

	def __init__(self, file):
		self._file = file
		self._fd = file.fileno()
		self.writable = 'x' in file.mode or 'w' in file.mode
		self.write = super(FastIO, self).write if self.writable else None

	def _fill(self):
		s = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
		self.seek((self.tell(), self.seek(0, 2), super(FastIO, self).write(s))[0])
		return s

	def read(self):
		while self._fill():
			pass
		return super(FastIO, self).read()

	def readline(self):
		while self.newlines == 0:
			s = self._fill()
			self.newlines = s.count(b'\n') + (not s)
		self.newlines -= 1
		return super(FastIO, self).readline()

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

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		if py2:
			self.write = self.buffer.write
			self.read = self.buffer.read
			self.readline = self.buffer.readline
		else:
			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')
main()


for _ in range(int(input())):
	(n, m, k) = map(int, input().split())
	s = 'abcdefghijklmnopqrstuvwxyz'
	a = n // k
	b = n % k
	print(s[:k] * a + s[:b])


def form_str(n, a, b):
	s = []
	rep = a - b
	curr = ord('a')
	for i in range(n):
		if i < rep:
			s.append('a')
		elif i < a:
			s.append(chr(curr))
			curr += 1
		else:
			s.append(s[i - a])
	print(''.join(s))
t = int(input())
for _ in range(t):
	(n, a, b) = map(int, input().split(' '))
	form_str(n, a, b)


t = int(input())
for tt in range(t):
	(n, a, b) = map(int, input().split())
	s = 'abcdefghijklmnopqrstuvwxyz'
	sol = s[:b] * n
	sol = sol[:n]
	print(sol)


for _ in range(int(input())):
	(n, a, b) = map(int, input().split())
	s = 'abcdefghijklmnopqrstuvwxyz'
	s1 = s[:b] * (n // b)
	if n % b != 0:
		for i in range(n % b):
			s1 += s[i]
	print(s1)


import math
t = int(input())
while t > 0:
	(n, a, b) = [int(ele) for ele in input().split()]
	res = math.ceil(a / b)
	alpha = 'abcdefghijklmnopqrstuvwxyz'
	st = ''
	i = 0
	while len(st) < a:
		if i < b:
			st += alpha[i]
			i += 1
		else:
			i = 0
			st += alpha[i]
			i += 1
	s = ''
	while len(s) < n:
		if len(s) + len(st) > n:
			diff = n - len(s)
			s += st[:diff]
		else:
			s += st
	print(s)
	t -= 1


from sys import stdin, stdout
input = stdin.buffer.readline
t = int(input())
alp = 'abcdefghijklmnopqrstuvwxyz'
while t > 0:
	a = [int(x) for x in input().split()]
	n = a[0]
	l = a[1]
	b = a[2]
	s = alp[:b]
	ans = ''
	for i in range(n):
		ans += s[i % b]
	print(ans)
	t -= 1


import string
t = int(input())
for case in range(t):
	(n, a, b) = [int(s) for s in input().split(' ')]
	x = string.ascii_lowercase
	ans = ((n // b + 1) * (x[0] * (b - a) + x[:b]))[:n]
	print(ans)


t = int(input())
alph = 'abcdefghijklmnopqrstuvwxyz'
for i in range(t):
	(n, a, b) = map(int, input().split())
	ans = alph[:b]
	lptr = 0
	while len(ans) < a:
		ans += alph[b - 1]
	while len(ans) < n:
		ans += ans[lptr]
		lptr += 1
	print(ans)


def main():
	t = int(input())
	for i in range(t):
		(n, a, b) = map(int, input().split())
		s = []
		for j in range(n):
			s.append(chr(97 + j % b))
		print(''.join(s))
main()


t = int(input())
for x in range(t):
	(n, a, b) = map(int, input().split())
	ch = 'a'
	List = []
	for c in range(0, b):
		List.append(chr(ord(ch) + c))
	diff = a - b
	for extra in range(diff):
		List.append(chr(ord(ch)))
	s = List[:]
	for x in range(1, n // a):
		List.extend(s)
	List += s[:n % a]
	print(''.join(List))


for u in range(int(input())):
	l = list(map(int, input().split()))
	n = l[0]
	a = l[1]
	b = l[2]
	bs = ''
	ast = ''
	for i in range(97, 97 + b):
		bs = bs + chr(i)
	ans = bs
	for j in range(b, n):
		ans = ans + bs[j % b]
	print(ans)


t = int(input())
for x in range(t):
	(n, a, b) = list(map(int, input().split(' ')))
	s = ''
	d = 0
	cc = [chr(nn) for nn in range(ord('a'), ord('a') + b)]
	for vx in range(n):
		s = s + cc[d]
		d = (d + 1) % b
	print(s)


t = int(input())
alpha = 'abcdefghijklmnopqrstuvwxyz'
for _ in range(t):
	(n, a, b) = map(int, input().split())
	sb = alpha[:b]
	print(sb * (n // b) + sb[:n % b])


l = 'abcdefghijklmnopqrstuvwxyz'
T = int(input())
for t in range(T):
	(n, a, b) = [int(x) for x in input().split()]
	unit = l[:b]
	rem = n % b
	req_str = unit * (n // b)
	req_str += unit[:rem]
	print(req_str)


def construct_string(length, window_size, number_of_distinct_letters):
	base = ''.join((chr(x) for x in range(ord('a'), ord('a') + number_of_distinct_letters)))
	base += base[-1] * (window_size - number_of_distinct_letters)
	return ''.join((base[idx % window_size] for idx in range(length)))
test_number = int(input())
for _ in range(test_number):
	(length, window_size, number_of_distinct_letters) = map(int, input().split())
	result = construct_string(length, window_size, number_of_distinct_letters)
	print(result)


for t in range(int(input())):
	(n, a, b) = map(int, input().split())
	s = list('abcdefghijklmnopqrstuvwxyz')
	print(''.join(s[:b] * (n // b) + s[:n % b]))


def solve():
	(n, a, b) = map(int, input().split())
	x = ''
	while len(x) < n:
		for i in range(b):
			x += chr(97 + i)
	print(x[:n])
for _ in range(int(input())):
	solve()


cases = int(input())
alphabet = 'abcdefghijklmnopqrstuvwxyz'
for i in range(cases):
	(n, a, b) = [int(x) for x in input().split()]
	string = ''
	for j in range(n):
		string += alphabet[j % b]
	print(string)


t = int(input())
while t > 0:
	n = [int(x) for x in input().split()]
	string = ''
	base = ''
	letter = 'a'
	for i in range(n[2]):
		base = base + letter
		temp = ord(letter) + 1
		letter = chr(temp)
	while True:
		string = string + base
		base = base[::-1]
		if len(string) >= n[1]:
			string = string[:n[1]]
			break
	while True:
		string = string + string
		if len(string) >= n[0]:
			string = string[:n[0]]
			break
	print(string)
	t = t - 1


from string import ascii_lowercase
length = int(input())
for i in range(length):
	(strLen, _, nletters) = map(int, input().split(' '))
	distinctSet = ascii_lowercase[:nletters]
	result = distinctSet * (strLen // nletters) + distinctSet[:strLen % nletters]
	print(result)


for _ in range(int(input())):
	(n, a, b) = map(int, input().split())
	g = ''
	for i in range(b):
		g += chr(97 + i)
	j = 0
	while len(g) != n:
		g += g[j]
		j += 1
	print(g)


t = int(input())
for i in range(0, t):
	(n, a, b) = [int(x) for x in input().split()]
	c = a - b
	x = []
	for j in range(0, b):
		x.append(int(j))
	for k in range(0, c):
		x.append(x[0])
	q = n // a
	r = n % a
	x = x * q
	for l in range(0, r):
		x.append(x[l])
	for m in range(0, n):
		x[m] = x[m] + ord('a')
		x[m] = chr(x[m])
	y = ''
	for o in range(0, n):
		y = y + x[o]
	print(y)


Alfabeto = 'abcdefghijklmnopqrstuvwxyz'
T = int(input())
for T in range(T):
	(n, a, b) = map(int, input().split())
	s = ''
	s = Alfabeto[0:b]
	s = s * (n // b + 1)
	s = s[0:n]
	print(s)


n = int(input())
ap = 'qwertyuiopasdfghjklzxcvbnm'
for i in range(n):
	ans = ''
	(nn, a, b) = map(int, input().split())
	if a == 1 and b == 1:
		while nn > 25:
			ans += ap
			nn = nn - 26
		ans += ap[:nn]
		print(ans)
	elif a == nn and b == 1:
		print('e' * nn)
	elif a == b:
		while nn > a:
			ans += ap[:a]
			nn = nn - a
		ans += ap[:nn]
		print(ans)
	else:
		ne = a - b
		st = 'q' * ne + ap[:b]
		while nn > a:
			ans += st
			nn = nn - a
		ans += st[:nn]
		print(ans)


t = int(input())
while t > 0:
	[a, b, c] = list(map(int, input().split()))
	s = 'a'
	for i in range(1, a):
		s += chr(i % c + 97)
	print(s)
	t -= 1


t = int(input())
for i in range(t):
	[n, a, b] = input().split()
	s = ''
	al = 'abcdefghijklmnopqrstuvwxyz'
	for i in range(int(n)):
		s = s + al[i % int(b)]
	print(s)


import itertools

def solveAll():
	nbCases = int(input())
	for _ in range(nbCases):
		(n, a, b) = readCase()
		print(solve(n, a, b))

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

def solve(n, a, b):
	pattern = ['a'] * a
	for i in range(b):
		pattern[i] = chr(ord('a') + i)
	chars = itertools.islice(itertools.cycle(''.join(pattern)), n)
	return ''.join(chars)
solveAll()


t = int(input())
for t_itr in range(0, t):
	(n, a, b) = map(int, input().split())
	q = n // b
	r = n - q * b
	string = ''
	ans = ''
	for i in range(0, b):
		string += chr(97 + i)
	ans += string * q
	string = ''
	for i in range(0, r):
		string += chr(97 + i)
	print(ans + string)


for t in range(int(input())):
	(n, a, b) = map(int, input().split())
	alp = 'abcdefghijklmnopqrstuvwxyz'
	x = alp[:b]
	s = x * (a // b)
	s += x[:a - len(s)]
	s += x * (n - len(s))
	print(s[:n])


s = 'abcdefghijklmnopqrstuvwxyz'
t = int(input())
for _ in range(t):
	(n, a, b) = map(int, input().split())
	for i in range(n):
		if i % a < b:
			print(s[i % a], end='')
		else:
			print(s[b - 1], end='')
	print('')


import string
t = int(input())
for num in range(t):
	[n, a, b] = list(map(int, input().split()))
	d = dict(enumerate(string.ascii_lowercase, 1))
	q = ''
	s = 'a' * (a - b + 1)
	q = s
	for i in range(1, b):
		q = s + d[i + 1]
		s = q
	p = q
	q = p * (n // a)
	s = p[:n % a]
	print(q + s)
	s = p = q = ''


t = int(input())
while t > 0:
	data = input()
	li = data.split()
	n = int(li[0])
	a = int(li[1])
	b = int(li[2])
	for i in range(n):
		sol = chr(ord('a') + i % b)
		print(sol, end='')
	print()
	t -= 1


t = int(input())
for _ in range(t):
	(n, a, b) = (int(i) for i in input().split())
	string = ''
	k = 0
	for i in range(n):
		string += chr(97 + k)
		k = (k + 1) % b
	print(string)


def main():
	t = int(input())
	ch = [chr(i) for i in range(ord('a'), ord('z') + 1)]
	for _ in range(t):
		(a, b, c) = map(int, input().split())
		for i in range(a):
			print(ch[i % c], end='')
		print()
main()


T = int(input())
while T > 0:
	(n, a, b) = tuple(map(int, input().split()))
	op = ''
	ch = 0
	for i in range(0, n):
		op += chr(ch + 97)
		ch += 1
		ch %= b
	print(op)
	T -= 1


test_num = input()
tests = []
for a in range(int(test_num)):
	tests.append([x for x in input().split()])
letters = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
for test in tests:
	result = ''
	pos = 0
	for n in range(int(test[0])):
		if pos == int(test[2]):
			pos = 0
		result += letters[pos]
		pos += 1
	print(result)


import string
t = int(input())
ab = string.ascii_lowercase
for i in range(t):
	(n, a, b) = map(int, input().split())
	j = 0
	s = ''
	for k in range(n):
		s += ab[j]
		j += 1
		if j >= b:
			j = 0
	print(s)


t = int(input())
for _ in range(t):
	(n, a, b) = map(int, input().split())
	x = 'a'
	s = ''
	b = b - 1
	for i in range(a):
		s = s + x
		if b > 0:
			b = b - 1
			x = chr(ord(x) + 1)
	for i in range(a, n):
		j = i % a
		s = s + s[j]
	print(s)


t = int(input())
for i in range(0, t):
	(n, a, b) = map(int, input().split())
	str = 'abcdefghijklmnopqrstuvwxyz'
	newstr = ''
	x = n // b
	y = n % b
	while x > 0:
		newstr += str[:b]
		x -= 1
	newstr += str[:y]
	print(newstr)


t = int(input())
for _ in range(t):
	(n, a, b) = map(int, input().split())
	if b == 1:
		print('a' * n)
	else:
		c = ''
		for i in range(b):
			c += chr(97 + i)
		for k in range(n // b):
			print(c, end='')
		print(c[:n % b])


alphabetlist = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
t = int(input())
ans = []
for i in range(0, t):
	(n, a, b) = map(int, input().split())
	x = a - b
	string = []
	for j in range(0, x):
		string.append('a')
	for j in range(0, b):
		string.append(alphabetlist[j])
	for j in range(0, n - a):
		string.append(string[j])
	answer = ''.join(string)
	ans.append(answer)
for i in range(0, t):
	print(ans[i])


for i in range(int(input())):
	(n, a, b) = list(map(int, input().split()))
	k = 0
	f = ''
	for j in range(n):
		f += chr(k + ord('a'))
		k = k + 1
		k = k % b
	print(f)


import sys
input = sys.stdin.readline
t = int(input())
for _ in range(t):
	(n, a, b) = map(int, input().split())
	for i in range(n):
		print(chr(97 + i % b), end='')
	print()


t = int(input())
while t:
	t -= 1
	(n, a, b) = input().split()
	(n, a, b) = (int(n), int(a), int(b))
	char = 97
	string = ''
	for i in range(n):
		if i > b - 1:
			break
		else:
			string = string + chr(char + i)
	ans = ''
	while len(ans) <= n:
		ans = ans + string
		string = string
	print(ans[:n])


t = int(input())
for i in range(t):
	(n, a, b) = map(int, input().split())
	val = 97 + 25
	s = ''
	dup = a - b + 1
	count = n // a
	rem = n % a
	aa = chr(val) * dup
	for j in range(1, b):
		aa += chr(val - j)
	s += aa * count
	for j in range(rem):
		s += aa[j]
	print(s)


for i in range(int(input())):
	s = ''
	al = 'abcdefghijklmnopqrstuvwxyz' * (2026 // 26)
	(n, a, b) = map(int, input().split())
	if a == b:
		s = al[:n]
	else:
		s = al[:b]
		var = n - b
		s1 = s * ((var + b) // b)
		s += s1[:var]
	print(s)


t = int(input())
for i in range(t):
	(n, a, b) = map(int, input().split())
	tmp = 0
	ini = []
	for i in range(a):
		ini.append(chr(tmp + 65 + 32))
		if b > tmp + 1:
			tmp += 1
	print(*ini, end='', sep='')
	for i in range((n - a + (a - 1)) // a):
		if i == (n - a + (a - 1)) // a - 1:
			if n % a == 0:
				print(*ini, end='', sep='')
			else:
				print(*ini[:n % a], end='', sep='')
		else:
			print(*ini, end='', sep='')
	print()


import string
import math
t = int(input())
alphabet = string.ascii_lowercase

def getCycleString(b):
	global alphabet
	s = str()
	for i in range(b):
		s += alphabet[i]
	return s
for i in range(t):
	(n, a, b) = map(int, input().split())
	result = str()
	cycleString = getCycleString(b)
	for i in range(math.ceil(n / b)):
		result += cycleString
	print(result[:n])


import sys
import string
input = sys.stdin.readline
for _ in range(int(input())):
	(n, a, b) = map(int, input().split())
	if a < b:
		s = string.ascii_lowercase[:b]
		print(s)
	else:
		s = string.ascii_lowercase[:b]
		d = n % b
		m = n // b
		ans = s * m
		k = string.ascii_lowercase[:d]
		print(ans + k)


t = int(input())
while t:
	t = t - 1
	(n, a, b) = [int(s) for s in input().split()]
	ans = [0] * n
	for i in range(b):
		ans[i] = chr(97 + i)
	for j in range(i + 1, a):
		ans[j] = ans[j - 1]
	if a == b:
		j = i
	x = 0
	for k in range(j + 1, n):
		ans[k] = ans[x]
		x = x + 1
	for i in range(n):
		print(ans[i], end='')
	print()


t = input()
res = [chr(x) for x in range(ord('a'), ord('z') + 1)]
res = ''.join(res)
for _ in range(int(t)):
	s = input().split()
	n = int(s[0])
	a = int(s[1])
	b = int(s[2])
	string = res[:b] * (n // b)
	rem = n % b
	string = string + res[:rem]
	print(string)


def inp():
	return int(input())

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

def insr():
	s = input()
	return list(s[:len(s)])

def invr():
	return map(int, input().split())
n = inp()
for i in range(n):
	l = inlt()
	m = l[0]
	a = l[1]
	b = l[2]
	a = 97
	end = a + b
	loop = m // b
	extra = m % b
	ans = ''
	for j in range(loop):
		for k in range(a, end):
			ans += chr(k)
	for j in range(extra):
		ans += chr(a + j)
	print(ans)


t = int(input())
while t > 0:
	(n, a, b) = [int(x) for x in input().split(' ')]
	ans = ''
	for i in range(b):
		ans += chr(i + 97)
	lc = ans[len(ans) - 1]
	sub = a - b
	for i in range(sub):
		ans += lc
	for i in range(a, n):
		ans += ans[i - a]
	print(ans)
	t -= 1


t = int(input())
chars = list(map(chr, range(97, 123)))
for _ in range(t):
	(n, a, b) = map(int, input().split())
	lst = chars[:b] + [chars[b - 1]] * (a - b)
	lst = lst * ((n + a) // a)
	lst = lst[:n]
	print(''.join(lst))


from sys import stdin, stdout
from math import *
from heapq import *
from collections import *
alphabets = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'.lower()

def main():
	global alphabets
	ntest = int(stdin.readline())
	for test in range(ntest):
		(n, a, b) = [int(x) for x in stdin.readline().split()]
		res = [alphabets[i % b] for i in range(n)]
		stdout.write('%s\n' % ''.join(res))
	return 0
main()


t = int(input())
alpha = 'abcdefghijklmnopqrstuvwxyz'
for _ in range(t):
	(n, a, b) = map(int, input().split())
	if a == b and n <= 26:
		print(alpha[:n])
		continue
	if a == b and n > 26:
		i = 0
		ans = ''
		while i < n:
			ans += alpha[i % 26]
			i += 1
		print(ans)
		continue
	ans = ''
	if a >= b:
		chr = alpha[:b]
		i = 0
		while i < n:
			ans += chr[i % b]
			i += 1
	print(ans)


import math
l = []
for i in range(26):
	l.append(chr(i + 97))
for i in range(int(input())):
	(n, a, b) = map(int, input().split())
	ans = l[:b] * math.ceil(n / b)
	ans = ans[:n]
	print(''.join(ans))


t = int(input())
for i in range(t):
	(n, a, b) = map(int, input().split())
	alphabet = 'abcdefghijklmnopqrstuvwxyz'
	str_needed = alphabet[:b]
	s = n // b * str_needed + str_needed[:n % b]
	print(s)


import string
n = int(input())
st = []
let = list(string.ascii_lowercase)
for i in range(n):
	st.append(list(map(int, input().split())))
for s in st:
	n = s[0]
	a = s[1]
	b = s[2]
	ans = ''
	while len(ans) != n:
		if n - len(ans) > b:
			for i in range(b):
				ans += str(let[i])
		else:
			for i in range(n - len(ans)):
				ans += str(let[i])
	print(ans)


for x in range(int(input())):
	(h, l, r) = list(map(int, input().split()))
	s = ''
	i = 0
	while i < r - 1:
		s += chr(97 + i)
		i += 1
	s += (l - r + 1) * chr(97 + i)
	k = len(s)
	s = s * (h // len(s))
	for i in range(h % k):
		s += s[i]
	print(s)


for t in range(int(input())):
	(n, a, b) = map(int, input().split(' '))
	s = 'abcdefghijklmnopqrstuvwxyz'
	s = s[0:b]
	while n >= b:
		print(s, end='')
		n -= b
	print(s[0:n])


t = int(input())
while t:
	s = ''
	(n, a, b) = map(int, input().split())
	temp = 0
	on = n
	origa = a
	n = n - a
	a = a - b
	if origa == 1:
		temp = 0
		while on:
			s = s + chr(temp + 97)
			temp += 1
			on -= 1
			if temp == 26:
				temp = 0
	else:
		while b:
			s = s + chr(temp + 97)
			temp += 1
			b -= 1
		if origa != 1:
			while a:
				s = s + s[len(s) - 1]
				a -= 1
		else:
			temp = 0
			while origa:
				s = s + chr(temp + 97)
				temp += 1
				origa -= 1
		temp = 0
		while n:
			s = s + s[temp]
			temp += 1
			n -= 1
	print(s)
	t = t - 1


n = int(input())
dizi = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
for k in range(n):
	A = [int(i) for i in input().split()]
	for i in range(A[0]):
		print(dizi[i % A[2]], end='')
	print()


from collections import defaultdict
for _ in range(int(input())):
	(n, a, b) = map(int, input().split())
	ans = ''
	dp = defaultdict(int)
	ch = []
	c = 97
	for i in range(26):
		ch.append(chr(c))
		c += 1
	point = 0
	i = 0
	while i < a:
		while i < b - 1:
			ans += ch[point]
			dp[ch[point]] += 1
			point += 1
			i += 1
		ans += ch[point]
		dp[ch[point]] += 1
		i += 1
	tmp = ans
	j = 0
	for i in range(a, n):
		if j > a - 1:
			j = 0
		ans += tmp[j]
		j += 1
	print(ans)


import math
t = int(input().strip())
for i in range(t):
	(n, a, b) = tuple(map(int, input().strip().split()))
	let = list(map(chr, range(97, 123)))
	nlet = 0
	j = 0
	stri = ''
	while nlet < n:
		stri += str(let[j])
		j = (j + 1) % b
		nlet += 1
	print(stri)


x = 'abcdefghijklmnopqrstuvwxyz'
for _ in range(int(input())):
	(n, a, b) = map(int, input().split())
	s = ''
	i = 0
	j = 0
	if a == 1 and b == 1:
		while i < n:
			s += x[j]
			i += 1
			j = (j + 1) % 26
		print(s)
	else:
		while i < b:
			s += x[i]
			i += 1
		while i < a:
			s += s[i - b]
			i += 1
		j = 0
		while i < n:
			s += s[j]
			i += 1
			j += 1
		print(s)


def solve(n, a, b):
	res = ''
	cont = ''
	for i in range(b):
		cont += chr(97 + i)
	if b < a:
		cont += cont[:a - b]
	for i in range(n):
		res += cont
		if len(res) >= n:
			break
	return res[:n]

def main():
	t = int(input())
	for i in range(t):
		d = input()
		d = [int(i) for i in d.split()]
		n = d[0]
		a = d[1]
		b = d[2]
		ans = solve(n, a, b)
		print(ans)
main()


nb_cases = int(input())
while nb_cases > 0:
	nb_cases -= 1
	(n, a, b) = [int(x) for x in input().split()]
	letters = ''
	for x in range(a):
		letters += chr(x % b + 97)
	for x in range(a, n):
		letters += letters[x - a]
	print(letters)


def RA():
	l = input().split()
	return [int(s) for s in l]

def solve():
	[n, a, b] = RA()
	s = ''
	for i in range(26):
		s += chr(ord('a') + i)
	s = s[:b]
	result = ''
	for i in range(n):
		result += s[i % b]
	print(result)
t = int(input())
for i in range(t):
	solve()


alf = 'abcdefghijklmnopqrstuvwxyz'

def solve(n, a, b):
	st = alf[0:b]
	ac = n
	res = ''
	while ac > 0:
		res += st[0:min(len(st), ac)]
		ac -= len(st)
	print(res)
t = int(input())
for i in range(t):
	(n, a, b) = map(int, input().split())
	solve(n, a, b)


alphabets = [chr(ord('a') + i) for i in range(0, 26)]
for _ in range(int(input())):
	(n, a, b) = map(int, input().split())
	res = ''
	for i in range(n):
		res += alphabets[i % b]
	print(res)


q = int(input())
for m in range(q):
	t = input()
	r = t.split()
	a1 = int(r[0])
	a2 = int(r[1])
	a3 = int(r[2])
	a = ''
	for i in range(a3):
		a += chr(97 + i)
	for i in range(a2 - a3):
		a += 'a'
	tmp = ''
	while a1 > a2:
		tmp += a
		a1 -= a2
	for i in range(a1):
		tmp += a[i]
	print(tmp)


import math
inp = input()
letters = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
for i in range(int(inp)):
	inp2 = input()
	inp2 = inp2.split(' ')
	n = inp2[0]
	a = inp2[1]
	b = inp2[2]
	x = 0
	word = []
	while len(word) < int(n):
		word.append(letters[x])
		if x < int(b) - 1:
			x += 1
		else:
			x = 0
	print(''.join(word))


t = int(input())
for _ in range(t):
	(n, a, b) = map(int, input().split())
	ch = 'a'
	l = []
	for i in range(26):
		l.append(chr(ord(ch) + i))
	temp = ''.join(l[:b])
	q = n // b
	r = n % b
	temp1 = temp * q
	temp2 = ''.join(temp[:r])
	ans = temp1 + temp2
	print(ans)


import sys
import math

def scan(input_type='int'):
	if input_type == 'int':
		return list(map(int, sys.stdin.readline().strip().split()))
	else:
		return list(map(str, sys.stdin.readline().strip()))

def solution():
	for _ in range(int(input())):
		(n, a, b) = scan()
		s = ''
		for i in range(b):
			s += chr(97 + i)
		s *= n // b
		s += s[:n % b]
		print(s)
solution()


alphabet = 'abcdefghijklmnopqrstuvwxyz'
for t in range(int(input())):
	(n, a, b) = map(int, input().split())
	key = 'a' * (a - b) + alphabet[:b]
	print(''.join([key[i % a] for i in range(n)]))


for _ in range(int(input())):
	(N, sub, need) = map(int, input().split())
	string = ''
	for n in range(need):
		string += chr(97 + n)
	while len(string) < N:
		string += string
	print(string[:N])


t = int(input())
arr = [chr(96 + i) for i in range(1, 27)]
for l in range(t):
	(n, _, k) = map(int, input().split())
	ans = []
	for i in range(n):
		ans.append(arr[i % k])
	print(''.join(ans))


t = int(input())
alpha = ['q', 'w', 'e', 'r', 't', 'y', 'u', 'i', 'o', 'p', 'a', 's', 'd', 'f', 'g', 'h', 'j', 'k', 'l', 'z', 'x', 'c', 'v', 'b', 'n', 'm']
while t:
	(n, a, b) = map(int, input().split())
	correct = []
	for i in range(b):
		correct.append(alpha[i])
	h = []
	k = 0
	for i in range(n):
		h.append(correct[k % b])
		k += 1
	print(str(h).replace(' ', '').replace('[', '').replace(']', '').replace(',', '').replace("'", ''))
	t -= 1


t = input()
t = int(t)
while t:
	t = t - 1
	(n, a, b) = [int(x) for x in input().split()]
	ls = list('abcdefghijklmnopqrstuvwxyz')
	ls = ls[:b]
	out = ''
	for i in range(n):
		out = out + ls[(i + 1) % b - 1]
	print(out)


alphabet = 'abcdefghijklmnopqrstuvwxyz'
tc = int(input())
while tc > 0:
	(n, a, b) = map(int, input().split())
	s = alphabet[0:b] * (n // b) + alphabet[0:n % b]
	print(s)
	tc -= 1


import sys
from functools import lru_cache, cmp_to_key
from heapq import merge, heapify, heappop, heappush
from math import ceil, floor, gcd, fabs, factorial, fmod, sqrt, inf, log
from collections import defaultdict as dd, deque, Counter as c
from itertools import combinations as comb, permutations as perm
from bisect import bisect_left as bl, bisect_right as br, bisect
mod = pow(10, 9) + 7
mod2 = 998244353

def data():
	return sys.stdin.readline().strip()

def out(var):
	sys.stdout.write(str(var))

def outln(var):
	sys.stdout.write(str(var) + '\n')

def l():
	return list(sp())

def sl():
	return list(ssp())

def sp():
	return map(int, data().split())

def ssp():
	return map(str, data().split())

def l1d(n, val=0):
	return [val for i in range(n)]

def l2d(n, m, val=0):
	return [l1d(n, val) for j in range(m)]
for _ in range(int(data())):
	(n, a, b) = sp()
	temp = 'a' * (a - b + 1)
	for i in range(1, b):
		temp += chr(i + 97)
	answer = temp * (n // a)
	k = n % a
	outln(answer + temp[:k])


test = int(input())
for i in range(test):
	(n, s, d) = map(int, input().split())
	apha = list(map(chr, range(97, 123)))
	rep = s - d
	out = apha[0:d]
	ln = 0
	ans = list()
	while ln < n:
		ans.extend(out)
		ans.extend([out[-1] for _ in range(rep)])
		ln = len(ans)
	print(''.join(ans[0:n]))


t = int(input())
for i in range(t):
	(n, a, b) = map(int, input().split())
	end = 97 + b
	res = ''
	for j in range(97, end):
		res = res + chr(j)
	size = len(res)
	for j in range(size, n):
		res = res + res[j - size]
	print(res)


rw = int(input())
for ewqr in range(rw):
	(n, a, b) = map(int, input().split())
	alph = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
	s = ''
	str = ''
	for i in range(a - b + 1):
		s = s + 'a'
	for i in range(b - 1):
		s = s + alph[i + 1]
	for i in range(n):
		str = str + s[i % a]
	print(str)


t = int(input())
while t != 0:
	t -= 1
	(n, a, b) = map(int, input().split())
	s = ''
	al = 'abcdefghijklmnopqrstuvwxyz'
	for i in range(n):
		s += al[:b]
	s = s[:n]
	print(s)


for _ in range(int(input())):
	(n, a, b) = map(int, input().split())
	alpha = 97
	count = 0
	for i in range(n):
		print(chr(alpha), end='')
		count = (count + 1) % b
		if count == 0 or alpha == 122:
			alpha = 97
		else:
			alpha += 1
	print()


t = int(input())
for i in range(t):
	(n, a, b) = map(int, input().split())
	if b == 1:
		s = 'a' * n
	elif a == b:
		s1 = ''
		j = ord('a')
		for h in range(a):
			s1 += chr(j)
			j += 1
		s = n // a * s1
		if n % a != 0:
			l = n // a * a
			h = 0
			while l < n:
				s += s1[h]
				l += 1
				h += 1
	else:
		j = ord('a')
		j1 = b - 1
		s1 = ''
		for h in range(a - 1):
			s1 += chr(j)
			if h < j1:
				j += 1
		if n % (a - 1) == 0:
			s = n // (a - 1) * s1
		else:
			s = s1 * (n // (a - 1))
			l = n // (a - 1) * (a - 1)
			h = 0
			while l < n:
				s += s1[h]
				l += 1
				h += 1
	print(s)


T = int(input())
for t in range(T):
	(n, a, b) = tuple(map(int, input().split()))
	st = ''
	for i in range(b - 1):
		st += chr(ord('a') + i)
	st += chr(ord('a') + b - 1) * (a - b + 1)
	print(st * (n // a) + st[:n % a])


t = int(input())
letters = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
listOfNums = []
while t > 0:
	t -= 1
	line = input().split(' ')
	listOfNums.append(line)
for line in listOfNums:
	n = int(line[0])
	a = int(line[1])
	b = int(line[2])
	out = ''
	for x in range(b):
		out += letters[x]
	while len(out) + len(out) < n:
		out += out
	if n - len(out) > 26 or len(out) < n:
		out += out[0:n - len(out)]
	print(out)


import string
t = int(input())
while t:
	t -= 1
	(n, a, b) = list(map(int, input().split()))
	barr = string.ascii_lowercase[:b]
	ans = ''
	remainder = n % b
	iterations = n // b
	while iterations:
		iterations -= 1
		ans += barr
	ans += barr[:remainder]
	if b <= a:
		print(ans)
	else:
		print('')


t = int(input())
for i in range(t):
	(n, a, b) = input().split()
	n = int(n)
	a = int(a)
	b = int(b)
	str = ''
	alpha = 'a'
	test_list = []
	for i in range(0, b):
		test_list.append(alpha)
		alpha = chr(ord(alpha) + 1)
	str = ''.join(test_list)
	while len(str) < n:
		str = str * 2
	str = str[0:n]
	print(str)


from string import ascii_lowercase
from math import ceil
alphabets = ascii_lowercase
t = int(input())
for case in range(t):
	ans = ''
	(n, a, b) = [int(n) for n in input().split()]
	for i in range(b):
		ans += alphabets[i]
	multiple = ceil(n / len(ans))
	ans *= multiple
	ans_list = [letter for letter in ans]
	while len(ans_list) > n:
		ans_list.pop()
	print(''.join(ans_list))


letters = 'abcdefghijklmnopqrstuvwxyz'
for _ in range(int(input())):
	(n, a, b) = map(int, input().split())
	s = ['a' for i in range(a - b)]
	for i in range(b):
		s.append(letters[i])
	for i in range(n):
		print(s[i % a], end='')
	print()


t = int(input())
alpha = 'abcdefghijklmnopqrstuvwxyz'
for _ in range(t):
	(n, a, b) = map(int, input().split())
	for i in range(n):
		print(alpha[i % b], end='')
	print()


t = int(input())
for test in range(t):
	(n, a, b) = [int(x) for x in input().split()]
	ch = []
	x = 'a'
	for i in range(b):
		ch.append(x)
		x = chr(ord(x) + 1)
	ans = ''
	c = 0
	i = 0
	while i < n:
		if c < b:
			ans += ch[c]
			i += 1
			c += 1
		else:
			ans += ch[c - 1] * min(a - b, n - i)
			i += a - b
			c = 0
	print(ans)


for _ in range(0, int(input())):
	(n, s, d) = map(int, input().split())
	x = ''
	for i in range(0, n):
		x = x + chr(97 + i % d)
	print(x)


t = int(input())
for _ in range(t):
	(n, a, b) = map(int, input().split())
	letters = 'abcdefghijklmnopqrstuvwxyz'
	ans = ''
	for i in range(n):
		ans += letters[i % b]
	print(ans)


t = int(input())
while t > 0:
	t -= 1
	(n, a, b) = map(int, input().strip().split(' '))
	s = ''
	for i in range(0, b - 1):
		s += str(chr(97 + i))
	for i in range(len(s), a):
		s += str(chr(96 + b))
	k = n // a
	ans = s
	for i in range(1, k):
		ans += s
	p = n % a
	if p:
		ans += s[:p]
	print(ans)


import sys
import random
from math import log2, log, ceil
input = sys.stdin.readline

def swaparr(arr, a, b):
	temp = arr[a]
	arr[a] = arr[b]
	arr[b] = temp

def gcd(a, b):
	if a > 0:
		return gcd(b % a, a)
	return b

def primefs(n):
	if n == 1:
		return 1
	primes = {}
	while n % 2 == 0:
		primes[2] = primes.get(2, 0) + 1
		n = n // 2
	for i in range(3, int(n ** 0.5) + 2, 2):
		while n % i == 0:
			primes[i] = primes.get(i, 0) + 1
			n = n // i
	if n > 2:
		primes[n] = primes.get(n, 0) + 1
	return primes

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

def find(x, link):
	while x != link[x]:
		x = link[x]
	return x

def union(x, y, size, link):
	x = find(x, link)
	y = find(y, link)
	if size[x] < size[y]:
		(x, y) = swap(x, y)
	if x != y:
		size[x] += size[y]
		link[y] = x

def sieve(n):
	prime = [True for i in range(n + 1)]
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * p, n + 1, p):
				prime[i] = False
		p += 1
	return prime
MAXN = int(1000000.0 + 5)

def spf_sieve():
	spf[1] = 1
	for i in range(2, MAXN):
		spf[i] = i
	for i in range(4, MAXN, 2):
		spf[i] = 2
	for i in range(3, ceil(MAXN ** 0.5), 2):
		if spf[i] == i:
			for j in range(i * i, MAXN, i):
				if spf[j] == j:
					spf[j] = i
spf = [0 for i in range(MAXN)]
spf_sieve()

def factoriazation(x):
	ret = {}
	while x != 1:
		ret[spf[x]] = ret.get(spf[x], 0) + 1
		x = x // spf[x]
	return ret

def int_array():
	return list(map(int, input().split()))
for _ in range(int(input())):
	(n, a, b) = int_array()
	alps = [chr(i) for i in range(97, 97 + 26)]
	string = ''.join(alps[:b])
	ans = ''
	for i in range(n // b):
		ans += string
	for i in range(n % b):
		ans += string[i]
	print(ans)


import sys
import io, os
input = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline
for _ in range(int(input())):
	(n, a, b) = map(int, input().split())
	start = ord('a')
	dis = 'a'
	bb = b
	b -= 1
	while b > 0:
		start = start + 1
		dis += chr(start)
		b -= 1
	org = dis
	index = 0
	n += a - bb
	while n > a:
		n -= 1
		dis += org[index % bb]
		index += 1
	print(dis)


def solve(a, b, n, ch):
	pos_ch = ch[:b]
	s = []
	i = 0
	while i < n:
		for char in pos_ch:
			if i >= n:
				break
			s.append(char)
			i += 1
	return ''.join(s)
n = ord('a')
ch = []
for i in range(26):
	ch.append(chr(n + i))
t = int(input())
while t:
	(n, a, b) = input().split()
	ans = solve(int(a), int(b), int(n), ch)
	print(ans)
	t -= 1


import string
T = int(input())
for _ in range(T):
	(n, a, b) = map(int, input().split())
	alphabet = list(string.ascii_lowercase)
	ans = ''
	for i in range(n):
		ans = ans + alphabet[i % b]
	print(ans)


n = int(input())
for i in range(n):
	(q, a, b) = map(int, input().split())
	otvet = ''
	asc = 97
	x = 0
	symvol = 0
	while symvol != q:
		otvet += chr(asc)
		asc += 1
		x += 1
		if x == b:
			x = 0
			asc = 97
		symvol += 1
	print(otvet)


t = int(input())
while t:
	inp = input().split(' ')
	n = int(inp[0])
	a = int(inp[1])
	b = int(inp[2])
	temp_ans = ''
	i = 0
	while i < a and b > 0:
		temp_ans += chr(97 + i)
		i += 1
		b -= 1
	temp_ans += temp_ans[-1] * (a - len(temp_ans))
	ans = temp_ans * (n // a)
	ans += temp_ans[:n - len(ans)]
	print(ans)
	t -= 1


from sys import stdin, stdout
from math import *
for __ in range(int(input())):
	(n, a, b) = map(int, input().split())
	s = ''
	for i in range(b):
		s += chr(i + 97)
	for i in range(n - b):
		s += s[i % b]
	print(s)


for _ in range(int(input())):
	(n, a, b) = list(map(int, input().split()))
	i = 0
	ans = ''
	while len(ans) < n:
		ans += chr(ord('a') + i)
		i = (i + 1) % b
	print(ans)


t = int(input())
while t > 0:
	(n, a, b) = input().split(' ')
	n = int(n)
	a = int(a)
	b = int(b)
	s1 = 'abcdefghijklmnopqrstuvwxyz'
	s2 = s1[:b]
	num = n // b
	s = s2 * num
	l2 = len(s)
	s = s + s2[:n - l2]
	print(s)
	t -= 1


t = int(input())
for i in range(t):
	(n, a, b) = list(map(int, input().strip().split(' ')))
	s = ''
	for i in range(b):
		s += chr(97 + i)
	ret = s * (n // b)
	for i in range(n % b):
		ret += chr(97 + i)
	print(ret)


s = 'abcdefghijklmnopqrstuvwxyz'
t = int(input())
for _ in range(t):
	(n, a, b) = list(map(int, input().split()))
	x = a // b
	y = a % b
	ans = s[:b] * x + s[:y]
	print(ans * (n // a) + ans[:n % a])


t = int(input())
for i in range(t):
	(n, a, b) = map(int, input().split())
	stri = ''
	for j in range(n):
		stri = stri + chr(97 + j % b)
	print(stri)


for _ in range(int(input())):
	(length, _, unique) = map(int, input().split())
	word = []
	while len(word) < length:
		for x in range(ord('a'), ord('a') + unique):
			word.append(chr(x))
	while len(word) != length:
		word.pop(-1)
	print(''.join(word))


letters = ('a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z')
t = int(input().strip())
for _ in range(t):
	args = [int(arg) for arg in input().strip().split(' ')]
	(n, b) = (args[0], args[2])
	s = ''
	j = 0
	for _ in range(n):
		s += letters[j]
		j += 1
		j %= b
	print(s)


t = int(input())
alp = 'abcdefghijklmnopqrstuvwxyz'
for _ in range(0, t):
	(n, a, b) = list(map(int, input().split()))
	b_str = alp[0:b]
	ans = b_str * (n // b)
	ans = ans + b_str[0:n % b]
	print(ans)


from sys import stdin
input = lambda : stdin.readline().strip()
from math import ceil, sqrt, factorial, gcd, log
for _ in range(int(input())):
	(n, a, b) = map(int, input().split())
	s = ''
	for i in range(ceil(a / b)):
		for j in range(97, 97 + b):
			s += chr(j)
			if len(s) == a:
				break
	for i in range(n // a):
		print(s, end='')
	print(s[:n % a])


from collections import deque
alpha = 'abcdefghijklmnopqrstuvwxyz'
t = int(input())
for i in range(t):
	(n, a, b) = map(int, input().split())
	segment_column = list('a' * (a - b) + alpha[:b])
	ans = deque(segment_column)
	temp = deque(segment_column)
	for i in range(n - a):
		l = temp.popleft()
		temp.append(l)
		ans.append(l)
	print(''.join(ans))


from sys import stdin
input = stdin.readline
for ti in range(int(input().strip())):
	(n, a, b) = [int(x) for x in input().strip().split()]
	s = []
	c = 'abcdefghijklmnopqrstuvwxyz'
	si = 0
	while si < n:
		sj = 0
		while si < n and sj < b:
			s.append(c[sj])
			sj += 1
			si += 1
	print(''.join(s))


for _ in range(int(input())):
	(n, a, b) = [int(i) for i in input().split()]
	s = []
	alpha = [chr(i) for i in range(97, 97 + b)]
	ans = ''.join(alpha)
	ans = ans * int((n + b) / b)
	ans = ans[:n]
	print(ans)


t = int(input())
for i in range(t):
	list1 = input().split()
	(n, a, b) = map(int, list1)
	string = ''
	for i in range(b):
		string = string + chr(i + 97)
	for i in range(b, a):
		string = string + string[-1]
	for i in range(0, n - a):
		string = string + string[i]
	print(string)


for _ in range(int(input())):
	(n, a, b) = map(int, input().split())
	ans = ''
	for i in range(n // b):
		for j in range(b):
			ans = ans + chr(97 + j)
	for k in range(n - b * (n // b)):
		ans = ans + chr(97 + k)
	print(ans)


base = 'abcdefghijklmnopqrstuvwxyz'
t = int(input())
for i in range(t):
	(n, a, b) = map(int, input().split())
	divide = n // b
	remain = n % b
	stng = base[:b]
	print(stng * divide + stng[:remain])


t = int(input())
for i in range(t):
	(n, a, b) = map(int, input().split())
	latin = 'qwertyuioplkjhgfdsazxcvbnm'
	slowo = latin[:b] + latin[b - 1] * (a - b)
	ile = n // a
	odp = ile * slowo + slowo[:n - ile * a]
	print(odp)


T = int(input())
for _ in range(T):
	(n, a, b) = [int(i) for i in input().split()]
	s = []
	for i in range(b):
		s.append(i + 97)
	for j in range(a - b):
		s.append(i + 97)
	pos = len(s)
	for i in range(pos, n):
		s.append(s[i % pos])
	print(''.join((chr(i) for i in s)))


import math

def again(n, a, b):
	st = 'abcdefghijklmnopqrstuvwxyz'
	(n, a, b) = map(int, input().split())
	c = math.ceil(a / b)
	sr = ''
	for i in range(b):
		sr = sr + st[i] * c
	count = 0
	if n == a:
		if n % 2 == 0:
			print(sr)
		else:
			print(sr[0:len(sr) - 1])
	else:
		for i in range(n - a - 1):
			sr = sr + sr[count]
			count = count + 1
		print(sr)
q = int(input())
for i in range(q):
	(n, a, b) = map(int, input().split())
	st = 'abcdefghijklmnopqrstuvwxyz'
	sr = ''
	if a == 1 and b == 1:
		i = 0
		count = 0
		while i < n:
			sr = sr + st[count]
			i = i + 1
			if count == 25:
				count = 0
			else:
				count = count + 1
		print(sr)
	else:
		for i in range(b):
			sr = sr + st[i]
		sr = sr * n
		print(sr[0:n])


import sys
input = sys.stdin.readline
from collections import defaultdict as dd
t = int(input())
while t:
	(n, a, b) = map(int, input().split())
	s = 'a' * (a - b + 1)
	for i in range(1, b):
		s += chr(ord('a') + i)
	for i in range(a, n):
		s += s[i - a]
	print(s)
	t -= 1


for _ in range(int(input())):
	(n, a, b) = map(int, input().split())
	p = 'abcdefghijklmnopqrstuvwxyz'
	s = p[:b]
	s = s + 'a' * (a - b)
	i = a
	while i < n:
		s += s[i - a]
		i += 1
	print(s)


for t in range(int(input())):
	(n, a, b) = map(int, input().split())
	letters = []
	for i in range(ord('a'), ord('a') + b):
		letters.append(chr(i))
	s = ''
	flag = False
	while True:
		for l in letters:
			s += l
			if len(s) == n:
				flag = True
				break
		if flag:
			break
	print(s)


for _ in range(int(input())):
	(n, a, b) = map(int, input().split())
	y = 97
	f = ''
	if b == 1:
		for i in range(n):
			print(chr(y), end='')
		print()
	else:
		q = n // b
		w = n % b
		for j in range(b):
			f += chr(y)
			y += 1
		f = f * q
		y = 97
		for k in range(w):
			f += chr(y)
			y += 1
		print(f)


import sys
for _ in range(int(sys.stdin.readline())):
	(n, a, b) = map(int, sys.stdin.readline().split())
	s = ['a'] * n
	y = 'abcdefghijklmnopqrstuvwxyz'
	k = 0
	for i in range(n):
		s[i] = y[k]
		if k == b - 1:
			k = 0
		else:
			k += 1
	print(''.join(s))


LETTERS = 'abcdefghijklmnopqrstuvwxyz'

def solve(n, a, b):
	global LETTERS
	l = 0
	r = 0
	s = []
	q = [0] * 26
	used = set()
	remains = set(LETTERS)
	for i in range(min(a, b)):
		s.append(LETTERS[i])
		c = ord(s[-1]) - ord('a')
		q[c] += 1
		used.add(s[-1])
		remains.remove(s[-1])
	r = len(s)
	while r < a:
		s.append(s[-1])
		q[ord(s[-1]) - ord('a')] += 1
		r += 1
	while r < n:
		cl = s[l]
		i = ord(cl) - ord('a')
		q[i] -= 1
		if q[i] == 0:
			used.remove(cl)
			remains.add(cl)
		if len(used) == b:
			s.append(s[-1])
		elif len(used) < b:
			nc = next(iter(remains))
			s.append(nc)
			used.add(nc)
			remains.remove(nc)
		q[ord(s[-1]) - ord('a')] += 1
		l += 1
		r += 1
	return ''.join(s)

def main():
	t = int(input())
	for _ in range(t):
		(n, a, b) = [int(i) for i in input().split()]
		print(solve(n, a, b))
main()


for testcase in range(int(input())):
	(n, a, b) = map(int, input().split())
	s = ''
	c = 0
	for i in range(n):
		s += chr(c % b + 97)
		c += 1
	print(s)


Q = 'qwertyuiopasdfghjklzxcvbnm'
t = int(input())
for i in range(t):
	(n, a, b) = map(int, input().split())
	q = Q[:b]
	ans = q * (n // b)
	h = n % b
	qq = Q[:h]
	ans += qq
	print(ans)


import sys
input = sys.stdin.readline
Q = int(input())
Query = [list(map(int, input().split())) for _ in range(Q)]
Alp = [chr(i) for i in range(97, 97 + 26)]
for (n, a, b) in Query:
	ans = ''
	for i in range(n):
		ans += Alp[i % b]
	print(ans)


t = int(input())
for i in range(t):
	(n, a, b) = list(map(int, input().split()))
	pos = 0
	for j in range(n):
		if j % a == 0:
			pos = 0
		print(chr(ord('a') + pos), end='')
		pos = (pos + 1) % b
	print()


for _ in range(int(input())):
	(n, a, b) = map(int, input().split())
	li = []
	val = 97
	for i in range(b):
		li.append(chr(val))
		val += 1
	end = val
	val = 97
	tmp = n // b
	res = li * tmp
	while len(res) != n:
		if val == end:
			val = 97
			res.append(chr(val))
			val += 1
		else:
			res.append(chr(val))
			val += 1
	print(*res, sep='')


t = int(input())
for i in range(t):
	(n, a, b) = map(int, input().split())
	res = ''
	for j in range(b):
		res += chr(97 + j)
	for j in range(b + 1, a + 1):
		res += chr(97)
	for j in range(a + 1, n + 1):
		res += res[j - a - 1]
	print(res)


from sys import stdout, stdin, setrecursionlimit
from math import log2, floor
mod = 1000000007
cin = stdin.readline
cout = stdout.write
import string
aplha = string.ascii_lowercase

def main():
	(n, a, b) = list(map(int, cin().split()))
	ans = ''
	for i in range(0, b):
		ans += aplha[i]
	for i in range(0, a - b):
		ans += aplha[b - 1]
	for i in range(a, n):
		ans += ans[-a]
	cout(f'{ans}\n')
t = 1
t = int(input())
while t > 0:
	main()
	t = t - 1


import string
alphabet = string.ascii_lowercase
t = int(input())
for i in range(t):
	(n, a, b) = map(int, input().split())
	ss = alphabet[0:b]
	print((ss * (n // len(ss) + 1))[:n])


t = int(input())
alpha = [chr(i) for i in range(97, 97 + 26)]
for ii in range(t):
	(n, a, b) = [int(i) for i in input().split()]
	final = ''.join(alpha[:b])
	ans = ''
	for i in range(n // b):
		ans += final
	ans += final[:n % b]
	print(ans)


test = int(input())
for _ in range(test):
	(n, a, b) = [int(x) for x in input().split()]
	arr = ['a'] * n
	index = 0
	while index < n:
		for i in range(index, min(n, index + b)):
			arr[i] = chr(i - index + ord('a'))
		index += a
	for item in arr:
		print(item, end='')
	print()


t = int(input())
alph = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
while t > 0:
	line = input()
	n = int(line.split(' ')[0])
	a = int(line.split(' ')[1])
	b = int(line.split(' ')[2])
	ss = 'a' * (a - b)
	for i in range(b):
		ss += alph[i]
	res = ss * (n // a)
	res += ss[0:n % a]
	print(res)
	t -= 1


import sys
import math
msg = sys.stdin.readlines()
l = []
for i in msg:
	l.append(list(map(int, i.split())))
l.remove(l[0])
s = 'qwertyuiopasdfghjklzxcvbnm'
for i in l:
	[n, a, b] = i
	st = s[0:b]
	mult = n // b + 1
	ans = st * mult
	ans = ans[:n]
	print(ans)


import math
t = int(input())
for _ in range(t):
	(n, a, b) = map(int, input().split())
	alpha = 'a'
	arr = []
	for i in range(0, 26):
		arr.append(alpha)
		alpha = chr(ord(alpha) + 1)
	arr2 = []
	for _ in range(n // b):
		for i in range(b):
			arr2.append(arr[i])
	for i in range(b):
		if len(arr2) < n:
			arr2.append(arr[i])
	print(''.join(arr2))


T = int(input())
import string
alphabets = list(string.ascii_lowercase)
for t in range(T):
	(n, a, b) = map(int, input().split())
	s = []
	for i in range(n):
		s.append(alphabets[i % b])
	for i in s:
		print(i, end='')
	print()


t = int(input())
S = 'abcdefghijklmnopqrstuvwxyz'
for i in range(t):
	(n, a, b) = map(int, input().split())
	k = n // b
	s = (S[:b] * (k + 1))[:n]
	print(s)


t = int(input())
for _ in range(t):
	(n, a, b) = map(int, input().split())
	num = 97
	ans = []
	i = 0
	while i < a:
		ans.append(chr(num))
		num = num + 1
		i = i + 1
		b = b - 1
		if b <= 0:
			j = 0
			while j < a - i:
				ans.append(ans[j])
				j = j + 1
			break
	i = a
	j = 0
	while i < n:
		ans.append(ans[j])
		j = j + 1
		i = i + 1
	print(''.join(ans))


for _ in range(int(input())):
	(n, a, b) = map(int, input().split())
	test_list = list(map(chr, range(97, 97 + b)))
	s = ''
	for i in test_list:
		s = s + i
	for i in range(n - b):
		a = test_list[0]
		s = s + test_list[0]
		test_list.pop(0)
		test_list.append(a)
	print(s)


for t in range(int(input())):
	s = 'qwertyuiopasdfghjklzxcvbnm'
	(n, a, b) = map(int, input().split())
	ans = ''
	for k in range(b):
		ans += s[k]
	x = ''
	for k in range(b, a):
		x += ans[(k - b) % b]
	y = ''
	ans += x
	for k in range(a, n):
		y += ans[(k - a) % a]
	print(ans + y)


import math
for i in range(int(input())):
	(n, a, b) = map(int, input().split())
	s = ''
	ss = ''
	if a != 1:
		for i in range(b):
			s += chr(97 + i)
		ss = s * math.ceil(n / b)
	else:
		j = -1
		for i in range(n):
			if i % 26 == 0 and i != 0:
				j = 0
				ss = ss + chr(97 + j)
			else:
				j += 1
				ss = ss + chr(97 + j)
	print(ss[:n])


t = int(input())
for i in range(t):
	(n, a, b) = map(int, input().split())
	if b == 1:
		print('a' * n)
	else:
		word = ''
		c = a - b
		for j in range(b):
			word += chr(97 + j)
		last = chr(97 + b - 1)
		while len(word) != a:
			word += last
		cw = ''
		for j in range(n // a):
			cw += word
		while len(cw) != n:
			cw += word[0:n % a]
		print(cw)


import math
t = int(input())
for g in range(0, t):
	nab = list(map(int, input().split()))
	n = nab[0]
	a = nab[1]
	b = nab[2]
	x = int(a / b)
	y = a % b
	k = 96
	s = ''
	for i in range(0, b - 1):
		k = k + 1
		for j in range(0, x):
			s = s + chr(k)
	k = k + 1
	for i in range(0, x + y):
		s = s + chr(k)
	p = int(n / len(s))
	q = n % len(s)
	g = ''
	for i in range(0, p):
		g = g + s
	for i in range(0, q):
		g = g + s[i]
	print(g)


q = int(input())
for i in range(q):
	(n, a, b) = map(int, input().split())
	print(''.join((chr(97 + j % b) for j in range(n))))


import math

def solve():
	c = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
	(n, a, b) = map(int, input().split())
	sub = ''
	for x in range(b):
		sub += c[x]
	sub += c[x] * (a - b)
	full = sub * math.ceil(n / a)
	print(full[:n])
t = int(input())
for x in range(t):
	solve()


n = int(input())
for _ in range(n):
	(t, a, b) = [int(i) for i in input().split()]
	s = ''
	for i in range(b):
		s += chr(i + 97)
	ans = s * (t // b) + s[:t % b]
	print(ans)


alphabet = 'abcdefghijklmnopqrstuvwxyz'
t = int(input())
import math
delay = []
for _ in range(t):
	(n, a, b) = map(int, input().split())
	sub = alphabet[:b]
	ans = ((n // b + 1) * sub)[:n]
	delay.append(ans)
for d in delay:
	print(d)


t = int(input())
while t:
	(n, a, b) = map(int, input().split())
	s = ''
	for i in range(n):
		if i < a:
			m = min(i, b - 1)
			s += chr(m + ord('a'))
		else:
			s += s[i - a]
	print(s)
	t -= 1


for _ in range(int(input())):
	(n, a, b) = map(int, input().split())
	add = ''.join(map(lambda x: chr(x + 96), range(1, b + 1)))
	ans = n // b * add + add[:n % b]
	print(ans)


import sys
input = sys.stdin.buffer.readline
tests = int(input())
for ii in range(tests):
	(n, a, b) = map(int, input().split())
	cnt = 0
	ans = ['#' for i in range(n)]
	for i in range(a):
		if cnt == b:
			ans[i] = ans[i - 1]
		else:
			cnt += 1
			ans[i] = chr(97 + i)
	for i in range(n):
		if ans[i] == '#':
			ans[i] = ans[i - a]
	print(*ans, sep='')


T = int(input())
for t in range(T):
	(N, a, b) = list(map(int, input().split()))
	for i in range(N):
		print(chr(ord('a') + i % b), end='')
	print()


ch = 'abcdefghijklmnopqrstuvwxyz'
for _ in range(int(input())):
	(n, a, b) = map(int, input().split())
	x = ch[:b] + (a - b) * ch[b - 1]
	while len(x) < n:
		x = x + x
	print(x[:n])


for _ in range(int(input())):
	st = 'abcdefghijklmnopqrstuvwxyz'
	(n, a, b) = map(int, input().split())
	s = ''
	if a == b:
		s = st[0:n]
		if n > 26:
			for j in range(0, n - 26):
				s += s[j]
		print(s)
	else:
		for j in range(b):
			s += st[j]
		for j in range(a - b):
			s += s[j]
		for j in range(n - a):
			s += s[j]
		print(s)


import os
import sys
from math import *
from io import BytesIO, IOBase

def vsInput():
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')

def array():
	return [int(i) for i in input().split()]
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))
input = lambda : sys.stdin.readline().rstrip('\r\n')
ans = ['q', 'w', 'e', 'r', 't', 'y', 'u', 'i', 'o', 'p', 'a', 's', 'd', 'f', 'g', 'h', 'j', 'k', 'l', 'z', 'x', 'c', 'v', 'b', 'n', 'm']
for _ in range(int(input())):
	(n, a, b) = map(int, input().split())
	s = ''
	dist = 0
	anss = ''.join(ans[0:b])
	while len(s) < n:
		s += anss
	print(s[0:n])


def solve(n, a, b):
	res = [0] * n
	for i in range(a):
		res[i] = chr(ord('a') + i % b)
	for j in range(a, n):
		res[j] = res[j - a]
	return ''.join(res)
t = int(input())
for _ in range(t):
	(n, a, b) = map(int, input().split())
	print(solve(n, a, b))
assert solve(7, 5, 3) == 'abcabab'
assert solve(8, 5, 3) == 'abcababc'
assert solve(6, 1, 1) == 'aaaaaa'
assert solve(6, 6, 1) == 'aaaaaa'
assert solve(6, 6, 2) == 'ababab'
assert solve(5, 2, 2) == 'ababa'
assert solve(5, 4, 4) == 'abcda'


letters = 'abcdefghijklmnopqrstuvwxyz'
t = int(input())
for i in range(t):
	(n, a, b) = list(map(int, input().split()))
	subString = letters[:b]
	numOfSubstring = n // b
	print(subString * numOfSubstring + letters[:n % b])


t = int(input())
for i in range(t):
	(n, a, b) = map(int, input().split())
	str1 = ''
	i = 97
	aa = b
	while aa > 0:
		str1 = str1 + chr(i)
		i = i + 1
		aa = aa - 1
	qq = n
	bb = 0
	if b > 0:
		qq = n // b
		bb = n - b * qq
	str2 = ''
	while qq > 0:
		str2 = str2 + str1
		qq = qq - 1
	str2 = str2 + str1[0:bb]
	print(str2)


n = int(input())
letters = 'abcdefghijklmnopqrstuvwxyz'
s = []
for i in range(n):
	(n, a, b) = map(int, input().split(' '))
	newletters = letters[0:b]
	l = int(n / b)
	ml = n % b
	s.append(newletters * l + newletters[0:ml])
for i in s:
	print(i)


alf = 'qwertyuioplkjhgfdsazxcvbnm'
for t in range(int(input())):
	(n, a, b) = map(int, input().split())
	st = alf[:b]
	st1 = st
	while len(st1) <= n:
		st1 += st
	print(st1[:n])


for _ in range(int(input())):
	(n, a, b) = list(map(int, input().split()))
	chars = 'abcdefghijklmnopqrstuvwxyz'
	ans = ''
	for i in range(b):
		ans += chars[i]
	for i in range(a - b):
		ans += chars[b - 1]
	for i in range(a, n):
		ans += ans[i - a]
	print(ans)


t = int(input())
letter = [i for i in range(97, 123)]
for _ in range(t):
	(n, a, b) = map(int, input().split())
	j = 0
	for i in range(n):
		if i % b == 0:
			j = 0
		print(chr(letter[j]), end='')
		j += 1
	print()


from sys import stdin
input = stdin.readline
for _ in range(int(input())):
	(n, _, b) = map(int, input().split())
	r = ''
	for i in range(b):
		r += chr(ord('a') + i)
	res = r * (n // b) + r[:n % b]
	print(res)


t = int(input())
for z in range(t):
	temp = input()
	l = temp.split(' ')
	n = int(l[0])
	a = int(l[1])
	b = int(l[2])
	ans = ''
	cnt = 0
	x = 'abcdefghijklmnopqrstuvwxyz'
	while cnt != n:
		for i in range(b):
			cnt += 1
			ans += x[i]
			if cnt == n:
				break
	print(ans)


letters = 'abcdefghijklmonpqrstuvwxyz'
for i in range(int(input())):
	(n, a, b) = map(int, input().split())
	substr = letters[:b]
	j = 0
	x = ''
	while j + b < n:
		x = x + substr
		j += b
	x = x + substr[:n - j]
	print(x)


sp = list('qwertyuiopasdfghjklzxcvbnm')
for i in range(int(input())):
	(a, b, c) = map(int, input().split())
	f = ''
	q = 0
	for j in range(a):
		f += sp[q]
		q += 1
		if q == c:
			q = 0
	print(f)


test = int(input())
while test != 0:
	(n, a, b) = [int(x) for x in input().split()]
	for i in range(n):
		print(chr(97 + i % b), end='')
	print()
	test -= 1


for _ in range(int(input())):
	(n, a, b) = map(int, input().split())
	s = 'qwertyuiopasdfghjklzxcvbnm'
	ans = ''
	for i in range(b):
		ans = ans + s[i]
	k = n // b + 1
	ans = ans * k
	print(ans[:n])


import string

def solve(n, a, b):
	s = ''
	L = string.ascii_lowercase[:a]
	i = 0
	while len(s) < n:
		s += L[i]
		i = (i + 1) % b
	return s
T = int(input())
for _ in range(T):
	(n, a, b) = (int(i) for i in input().split())
	print(solve(n, a, b))


t = int(input())
for _ in range(t):
	(n, a, b) = map(int, input().split())
	fill_value = chr(ord('a') + b - 1)
	s = ''.join([chr(ord('a') + i) for i in range(b)])
	s += fill_value * (a - b)
	ss = s * (n // a + 1)
	print(ss[:n])


import sys

def get_ints():
	return map(int, sys.stdin.readline().strip().split())
for _ in range(int(input())):
	(n, a, b) = get_ints()
	print(('abcdefghijklmnopqrstuvwxyz'[:b] * n)[:n])


t = int(input())
for i in range(t):
	(n, a, b) = list(map(int, input().split()))
	s = []
	for j in range(b):
		if j < b - 1:
			s.append(chr(97 + j))
		else:
			s.append((a - b + 1) * chr(97 + j))
	s = ''.join(s)
	s = s * (n // a)
	s = ''.join([s, s[0:n - a * (n // a)]])
	print(s)


alphabet = 'abcdefghijklmnopqrstuvwxyz'
for i in range(int(input())):
	(n, a, b) = map(int, input().split())
	val = n // b
	ans = alphabet[:b] * (val + 1)
	print(ans[:n])


import string
for t in range(int(input())):
	(n, a, b) = map(int, input().split())
	print(f'{string.ascii_letters[0:b] * (n // b)}{string.ascii_letters[0:n % b]}')


n = int(input())
q = 'qwertyuiopasdfghjklzxcvbnm'
for i in range(n):
	w = ''
	o = ''
	(a, b, c) = map(int, input().split())
	for j in range(c):
		w += q[j]
	w = w * (a // len(w) + 1)
	for j in range(a):
		print(w[j], end='')
	print()


number_test = int(input())
for k in range(number_test):
	nab = input().split(' ')
	(n, a, b) = (int(nab[0]), int(nab[1]), int(nab[2]))
	tab = [k + 97 for k in range(b)]
	string = ''.join(map(chr, tab))
	mod = n // b
	r = n % b
	sol = ''
	for i in range(mod):
		sol += string
	sol += string[:r]
	print(sol)


t = int(input())
alpha = 'qwertyuiopasdfghjklzxcvbnm'
for _ in range(t):
	(n, a, b) = map(int, input().split())
	print(alpha[:b] * (n // b) + alpha[:n % b])


k = int(input())
for i in range(k):
	result_string = ''
	(n, a, b) = map(int, input().split())
	for j in range(n):
		result_string += chr(ord('a') + j % b)
	print(result_string)


from string import ascii_letters as alpha

def solve():
	(n, a, b) = map(int, input().split())
	ans = alpha[0:b]
	ans = ans[0] * (a - b) + ans
	while len(ans) < n:
		ans += ans
	print(ans[0:n])
t = int(input())
while t > 0:
	t -= 1
	solve()


for _ in range(int(input())):
	(n, a, b) = map(int, input().split())
	(s, res) = ('qwertyuiopasdfghjklzxcvbnm'[:b], '')
	for i in range(n):
		res += s[i % b]
	print(res)


t = int(input())
for iii in range(t):
	(n, a, b) = map(int, input().split())
	k = 1
	ik = 97
	s = ''
	k1 = 0
	while True:
		if len(s) == n:
			break
		if len(s) % a == 0:
			k = 1
		if len(s) % a < a - b + 1:
			s += 'a'
		else:
			s += chr(ik + k)
			k += 1
	print(s)


import sys
INT_MAX = sys.maxsize
INT_MIN = -sys.maxsize
sys.setrecursionlimit(10 ** 7)
mod = 1000000007

def IOE():
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')

def main():
	t = int(sys.stdin.readline())
	for _ in range(t):
		(n, a, b) = map(int, sys.stdin.readline().split())
		t = 'abcdefghijklmnopqrstuvwxyz'
		need = t[:b]
		s = ''
		for i in range(n):
			for j in need:
				s += j
		print(s[:n])
try:
	IOE()
except:
	pass
main()


def r(t=int):
	return list(map(t, input().split()))

def cd(it):
	ret_val = dict()
	for v in it:
		ret_val[v] = ret_val.get(v, 0) + 1
	return ret_val
for _ in range(r()[0]):
	(n, a, b) = r()
	s = ''
	while len(s) <= n:
		s += 'qwertyuiopsdfghjklzxcvbnm'[:b - 1]
		s += 'a' * (a - b + 1)
	print(s[:n])


for x in range(int(input())):
	(n, a, b) = map(int, input().split())
	alp = []
	for i in range(26):
		alp += [chr(97 + i)]
	ans = ''
	flag = True
	while flag:
		for i in range(a - b + 1):
			ans += 'a'
			if len(ans) == n:
				flag = False
				break
		if flag:
			for i in range(1, b):
				ans += alp[i]
				if len(ans) == n:
					flag = False
					break
	print(ans)


for u in range(int(input())):
	(n, x, y) = map(int, input().split())
	l = 'abcdefghijklmnopqrstuvxwyz'
	z = n // y
	r = n % y
	s = l[:y] * z + l[:r]
	print(s)


r = 'abcdefghijklmnopqrstuvwxyz'
for _ in range(int(input())):
	(n, a, b) = map(int, input().split())
	t = r[:b]
	t += t[-1] * (a - b)
	print((t * ((n + len(t) - 1) // len(t)))[:n])


from math import *
t = int(input())
for _ in range(t):
	(n, a, b) = map(int, input().split())
	l = []
	for i in range(26):
		l.append(chr(97 + i))
	r = []
	for i in range(b):
		r.append(l[i])
	i = 0
	while i < n:
		for j in range(b):
			print(r[j], end='')
			i = i + 1
			if i >= n:
				break
	print()


n = int(input())
for i in range(n):
	(a, b, c) = map(int, input().split())
	l = 'abcdefghijklmnopqrstuvwxyz'
	if a == b == c:
		print(l[:c])
	elif a == b and b > c:
		l1 = ''
		v = a // c
		r = a - v * c
		l1 = l1 + l[:c] * v
		r1 = l[:r]
		l1 = l1 + r1
		print(l1)
	elif a > b and b == c:
		l1 = ''
		if a <= 26:
			l1 = l1 + l[:a]
			print(l1)
		else:
			v = a // 26
			u = a - v * 26
			l1 = l1 + l * v + l[:u]
			print(l1)
	elif a > b and b > c:
		l1 = ''
		v = a // c
		r = a - v * c
		l1 = l1 + l[:c] * v
		r1 = l[:r]
		l1 = l1 + r1
		print(l1)


def stringer(n, a, b):
	c = 'abcdefghijklmnopqrstuvwxyz'
	sub = c[:b]
	temp = n
	ans = ''
	while temp - b > 0:
		temp = temp - b
		ans += sub
	return ans + sub[:temp]
for i in range(int(input())):
	(n, a, b) = map(int, input().split())
	print(stringer(n, a, b))


from math import ceil
a = int(input())
for k in range(a):
	c = list(map(int, input().split()))
	string = 'abcdefghijklmnopqrstuvwxyz'
	temp = string[:c[2]]
	answer = ''
	for i in range(c[0] - c[2]):
		temp = temp + temp[i]
	print(temp)


alpha = 'a'
listA = []
for i in range(0, 26):
	listA.append(alpha)
	alpha = chr(ord(alpha) + 1)
for t in range(int(input())):
	(n, a, b) = map(int, input().split())
	s = []
	i = 0
	j = 0
	for j in range(n):
		s.append(listA[j % b])
	print(''.join(s))


t = int(input())
for i in range(t):
	(n, a, b) = map(int, input().split(' '))
	s = ''
	for j in range(b):
		s += chr(ord('a') + j)
	s += s[-1] * (a - b)
	diff = b
	for j in range(a + 1, n + 1):
		if len(s) > j - a:
			if s[j - a - 1] != s[j - a]:
				diff -= 1
		if diff == b:
			s += s[-1]
		else:
			diff += 1
			if s[-1] == 'z':
				s += 'a'
			else:
				s += chr(ord(s[-1]) + 1)
	print(s)


l = 'abcdefghijklmnopqrstuvwxyz'
for _ in range(int(input())):
	(n, a, b) = map(int, input().split())
	tmp = l[:b]
	res = tmp * (n // b) + tmp[:n % b]
	print(res)


t = int(input())
for i in range(t):
	s = ''
	(n, a, b) = map(int, input().split())
	while len(s) < n:
		newS = ''
		for j in range(b):
			newS += chr(ord('a') + j)
		s += newS
	print(s[:n])


n = int(input())
while n:
	n -= 1
	(m, a, b) = map(int, input().strip().split(' '))
	s = set()
	x = ord('a')
	li = []
	k = 0
	for i in range(b):
		s.add(chr(x + i))
	for i in range(0, m, b):
		for x in s:
			if k < m:
				k += 1
				li.append(x)
	print(*li, sep='')


from string import ascii_lowercase as abc
t = int(input())
for y in range(0, t):
	nab = [int(x) for x in input().split()]
	(n, a, b) = (nab[0], nab[1], nab[2])
	b_string = abc[0:b]
	b_times = n // b + 1
	print((b_times * b_string)[0:n])


q = int(input())
S = 'abcdefghijklmnopqrstuvwxyz'
for _ in range(q):
	(n, a, b) = map(int, input().split())
	s = ''
	for k in range(b):
		s += S[k]
	for k in range(a - b):
		s += S[b - 1]
	while len(s) <= n:
		s = s + s
	print(s[:n])


t = int(input())
for i in range(t):
	w = [int(i) for i in input().split()]
	s = ''
	for i in range(97, 97 + w[2]):
		s += chr(i)
	a = ''
	for i in range(0, w[0]):
		a += s[i % w[2]]
	print(a)


t = int(input())
for i in range(t):
	nab = input().split()
	n = int(nab[0])
	a = int(nab[1])
	b = int(nab[2])
	string = []
	j = 0
	for i in range(a):
		string.append(chr(j + 97))
		if j + 1 < b:
			j = j + 1
	repeatingLetter = 0
	while True:
		if len(string) >= n:
			break
		string.append(string[repeatingLetter])
		repeatingLetter = repeatingLetter + 1
	for letter in string:
		print(letter, end='')
	print()


import sys
input = sys.stdin.buffer.readline

def solution():
	(n, a, b) = map(int, input().split())
	s = 'abcdefghijklmnopqrstuvwxyz'
	l = ''
	ans = ''
	for i in range(b):
		l += s[i]
	x = len(l)
	for i in range(n):
		ans += l[i % x]
	print(ans)
for _ in range(int(input())):
	solution()


m = int(input())
for i in range(m):
	(n, a, b) = map(int, input().split())
	alf = [chr(i) for i in range(ord('a'), ord('a') + b)]
	seq = alf.copy()
	seq.extend([alf[-1]] * (a - b))
	okno = [1] * (b - 1) + [a - b + 1]
	ans = ''.join(seq)
	j = b - 1
	for i in range(a, n):
		c = seq[0]
		seq.pop(0)
		ord_ = ord(c) - ord('a')
		okno[ord_] -= 1
		if okno.count(0) != 0:
			j = (j + 1) % b
		seq.append(alf[j])
		ans += alf[j]
		okno[j] += 1
	print(ans)


c = int(input())
for _ in range(c):
	str = input().split()
	n = int(str[0])
	a = int(str[1])
	b = int(str[2])
	ans = ''
	for i in range(n):
		ans += chr(i % b + 97)
	print(ans)


alp = 'abcdefghijklmnopqrstuvwxyz'
for qq in range(int(input())):
	(n, a, b) = map(int, input().split())
	(d, m) = divmod(n, b)
	print(alp[:b] * d + alp[:m])


tc = int(input())
for _ in range(tc):
	(a, b, c) = map(int, input().split())
	s = ''
	for i in range(c):
		s += chr(97 + i)
	s2 = ''
	for i in range(b):
		s2 += s[i % c]
	ans = ''
	for i in range(a):
		ans += s2[i % b]
	print(ans)


import sys

def read_line():
	return sys.stdin.readline()

def solve(n, a, b):
	(start, end) = (97, 97 + b - 1)
	lst = [chr(i) for i in range(start, end)]
	for i in range(a - len(lst)):
		lst.append(chr(end))
	l = 0
	i = len(lst) - 1
	while i <= n:
		if i - l > a:
			lst.append(lst[l])
			l += 1
		i += 1
	print(''.join(lst))
n = int(read_line())
for i in range(n):
	line = read_line().split(' ')
	solve(int(line[0]), int(line[1]), int(line[2]))


n = int(input())
ch = 'abcdefghijklmnopqrstuvwxyz'
ch = list(ch)
for i in range(n):
	p = list(map(int, input().split()))
	a = []
	s = ''
	for j in range(p[2]):
		a.append(ch[j])
	for j in range(p[0]):
		ind = j % p[2]
		s += a[ind]
	print(s)


for i1 in range(int(input())):
	(n, a, b) = map(int, input().split())
	s = ''
	x = 'a'
	for i in range(b):
		s += x
		x = chr(ord(x) + 1)
	str = s * (a // b)
	if len(str) != a:
		str = str + s[:a - len(str)]
	str1 = str * (n // a)
	if len(str1) != n:
		str1 = str1 + str[:n - len(str1)]
	print(str1)


import string

def main():
	t = int(input())
	for _ in range(t):
		(n, a, b) = [int(x) for x in input().split(' ')]
		if b < a:
			result = (string.ascii_lowercase[1:b] + (a - b + 1) * 'a') * (n // a + 1)
		else:
			result = string.ascii_lowercase * (n // a + 1)
		print(''.join(result[:n]))
main()


t = int(input())
S = ['q', 'w', 'e', 'r', 't', 'y', 'u', 'i', 'o', 'p', 'a', 's', 'd', 'f', 'g', 'h', 'j', 'k', 'l', 'z', 'x', 'c', 'v', 'b', 'n', 'm']
for _ in range(t):
	(n, a, b) = map(int, input().split())
	S1 = []
	for i in range(b):
		S1.append(S[i])
	ANS = []
	for i in range(n // b):
		ANS.extend(S1)
	for i in range(n % b):
		ANS.append(S1[i])
	print(''.join(ANS))


t = int(input())
alpha = 'abcdefghijklmnopqrstuvwxyz'
for _ in range(t):
	(n, a, b) = list(map(int, input().split()))
	substr = alpha[:b]
	for _ in range(a - b):
		substr += substr[-1]
	c = n // a
	substr *= c
	r = n % a
	substr += substr[:r]
	print(substr)


rr = lambda : input()
rri = lambda : int(rr())
rrm = lambda : [int(x) for x in rr().split()]
from math import log, floor

def sol():
	(n, a, b) = rrm()
	res = ''
	k = 'abcdefghijklmnopqrstuvwxyz'
	c = k[:b]
	while n >= b:
		res += c
		n -= b
	res += c[:n]
	return res
T = rri()
for _ in range(T):
	ans = sol()
	print(ans)


from sys import stdin

def solve(tc):
	(n, a, b) = map(int, stdin.readline().split())
	s = ''
	for i in range(b):
		s += chr(97 + i)
	for i in range(n - b):
		s += chr(97 + i % b)
	print(s)
LOCAL_TEST = not __debug__
if LOCAL_TEST:
	infile = __file__.split('.')[0] + '-test.in'
	stdin = open(infile, 'r')
tcs = int(stdin.readline().strip())
tc = 1
while tc <= tcs:
	solve(tc)
	tc += 1


from collections import defaultdict
from collections import Counter
from string import ascii_lowercase
import math
from sys import setrecursionlimit as srl
srl(2 * 10 ** 6)

def solve(n, a, b):
	arr = [0] * (2 * n)
	A = a
	j = 0
	while a > 0:
		for i in range(97, 97 + b):
			arr[j] = chr(i)
			j += 1
		a = a - b
	a = A
	r = []
	while n > 0:
		if n - a >= 0:
			for i in range(a):
				r.append(arr[i])
		else:
			val = n
			for i in range(val):
				r.append(arr[i])
			break
		n = n - a
	return ''.join(r)
t = int(input())
while t:
	(n, a, b) = map(int, input().split())
	print(solve(n, a, b))
	t -= 1


t = int(input())
for j in range(t):
	(n, a, b) = map(int, input().split())
	s = str()
	diff = a - b
	i = 0
	while i < n:
		for k in range(diff):
			if i < n:
				s += 'a'
				i += 1
			else:
				break
		ordd = 97
		k = 0
		while k < b:
			if i < n:
				s += chr(ordd)
				k += 1
				ordd += 1
				i += 1
			else:
				break
	print(s)


for _ in range(int(input())):
	(n, a, b) = map(int, input().split())
	s = 'abcdefghijklmnopqrstuvwxyz'
	ch = ''
	if a == b:
		x = s[:a]
		ch = x * (n // a) + x[:n % a]
	else:
		x = a - b + 1
		petit = 'a' * x + s[1:1 + a - x]
		ch = petit * (n // a) + petit[:n % a]
	print(ch)


from sys import stdin, stdout

def write(_s):
	stdout.write(_s)

def writeint(_s):
	stdout.write(str(_s))

def writelist(_l):
	stdout.write(''.join(_l))

def read():
	return stdin.readline().strip().split(' ')

def readint():
	return int(stdin.readline().strip())

def readints():
	return map(int, stdin.readline().strip().split(' '))
first = ord('a')
t = readint()
while t:
	(n, a, b) = readints()
	s = [''] * n
	letter = 0
	for i in range(n):
		s[i] = chr(letter % b + first)
		letter += 1
	writelist(s)
	write('\n')
	t -= 1


t = int(input())
for v in range(t):
	(n, a, b) = map(int, input().split())
	f = [chr(i) for i in range(ord('a'), ord('a') + b)]
	for i in range(n):
		print(f[i % b], end='')
	print()


def program():
	(n, a, b) = map(int, input().split())
	s = 'abcdefghijklmnopqrstuvwxyz'
	ans = ''
	if a == b:
		ans = s * (n // 26 + 1)
		print(ans[:n])
		return
	for i in range(b):
		ans += s[i]
	add = ans
	for i in range(n // b + 1):
		ans += add
	print(ans[:n])
t = int(input())
for i in range(t):
	program()


t = int(input())
for i in range(t):
	(n, a, b) = map(int, input().split())
	lett = []
	s = ''
	ps = ''
	for i in range(97, 97 + b):
		lett.append(chr(i))
	for i in range(a):
		ps += lett[i % b]
	s = n // a * ps
	s += ps[:n % a]
	print(s)


t = int(input())
for i in range(t):
	b = input().split()
	n = int(b[0])
	b = int(b[2])
	x = ''
	for i in range(n):
		x += chr(97 + i % b)
	print(x)


t = int(input())
for _ in range(t):
	(n, a, b) = map(int, input().split())
	ans = ''
	for i in range(n):
		print(chr(i % b + ord('a')), end='')
	print()


t = int(input())
for j in range(t):
	(n, a, b) = [int(x) for x in input().split()]
	c = 97
	i = b
	s = ''
	for i in range(b):
		s += chr(c + i)
		k = chr(c + i)
	s += k * (a - b)
	s += s * (n // a)
	print(s[0:n])


def main():
	test = int(input())
	for t in range(test):
		l = [int(i) for i in input().split(' ')]
		n = l[0]
		a = l[1]
		b = l[2]
		s = '' + 'a' * (a - b + 1)
		ch = 98
		for i in range(b - 1):
			s += chr(ch)
			ch += 1
		ind = 0
		for i in range(n - a):
			s += s[ind]
			ind += 1
		print(s)
main()


for _ in range(int(input())):
	(n, a, b) = map(int, input().split())
	s = ''
	for i in range(1, b + 1):
		s += chr(i + 96)
	s = s * (n // b)
	for i in range(1, n % b + 1):
		s += chr(i + 96)
	print(s)


x = int(input())
i = 0
while i < x:
	lst = list(map(int, input().split()))
	strLen = lst[0]
	subLen = lst[1]
	dist = lst[2]
	str1 = ''
	j = 0
	b = 97
	substr = ''
	while j < dist:
		str1 = str1 + chr(b)
		b += 1
		j += 1
	fix = str1
	div = subLen // dist
	j = 0
	while j < div:
		substr += str1
		j += 1
	left = strLen - div * dist
	available = left // dist
	j = 0
	while j < available:
		substr += fix
		j += 1
	left = strLen - len(substr)
	j = 0
	while j < left:
		substr += fix[j]
		j += 1
	print(substr)
	i += 1


from collections import defaultdict
for _ in range(int(input())):
	(N, A, B) = map(int, input().split())
	S = 'abcdefghijklmnopqrstuvwxyz'
	S = S[:B]
	L = ''
	i = 0
	while i < N:
		L += S[i % B]
		i += 1
	print(L)


import string
c = []
for i in string.ascii_lowercase:
	c.append(i)
for i in range(int(input())):
	a = [int(x) for x in input().split()]
	n = a[0]
	r = a[1]
	l = a[2]
	print(*n // l * c[:l] + c[:n % l], sep='')


for t in range(int(input())):
	(n, a, b) = [int(x) for x in input().split(' ')]
	s = ''
	for i in range(1, b + 1):
		s += chr(96 + i)
	s = s * a
	s = s[:a]
	s = s * n
	s = s[:n]
	print(s)


def solution():
	from sys import stdout, stdin
	(_input, _print) = (stdin.readline, stdout.write)
	(_int, _range) = (int, range)
	alfabhet = 'abcdefghijklmnopqrstuvwxyz'
	for _ in range(int(input())):
		(n, a, b) = [int(i) for i in input().split()]
		s = alfabhet[:b] + alfabhet[b - 1] * (a - b)
		k = n // a + 1
		print((s * k)[:n])
solution()


t = int(input())
for _ in range(t):
	(n, a, b) = map(int, input().split())
	if b == 1:
		print('a' * n)
	elif a == b:
		ans = ''
		while len(ans) < n:
			for i in range(ord('a'), ord('a') + 26):
				ans += chr(i)
				if len(ans) == n:
					break
		print(ans)
	else:
		ans = ''
		while len(ans) < n:
			for i in range(ord('a'), ord('a') + b):
				ans += chr(i)
				if len(ans) == n:
					break
		print(ans)


for _ in range(int(input())):
	(n, a, b) = map(int, input().split())
	pot = ord('a')
	ans = 'a' * (a - (b - 1))
	for i in range(1, b):
		ans += chr(pot + i)
	ans *= n
	print(ans[:n])


import sys
import string
t = int(sys.stdin.readline())
alpha_list = list(string.ascii_lowercase)
for _ in range(t):
	(n, a, b) = map(int, sys.stdin.readline().split())
	arr = []
	for i in range(n):
		arr.append(alpha_list[i % b])
	print(''.join(arr))


t = int(input())
for _ in range(t):
	(n, a, b) = map(int, input().split())
	interv = ''
	for i in range(b):
		interv += chr(ord('a') + i)
	for j in range(a - b):
		interv += 'a'
	ans = interv
	i = 0
	while len(ans) < n:
		ans += interv[i]
		i = (i + 1) % len(interv)
	print(ans)


a = int(input())
for ufwi in range(a):
	string = 'abcdefghijklmnopqrstuvwxyz'
	lst = input().split()
	lst = [int(p) for p in lst]
	length = lst[0]
	n = lst[2]
	o = ''
	for i in range(length):
		o = o + string[i % n]
	print(o)


a = 'abcdefghijklmnopqrstuvwxyz'
b = int(input())
for i in range(b):
	(c, d, e) = map(int, input().split())
	print(a[:e] * (c // e) + a[:c % e])


import sys
readLine = lambda : sys.stdin.readline()
readInt = lambda : int(sys.stdin.readline())
readInts = lambda : [int(x) for x in sys.stdin.readline().split(' ')]

def main():
	solns = []
	t = readInt()
	for _ in range(t):
		(n, a, b) = readInts()
		s = 'abcdefghijklmnopqrstuvwxyz'[:b]
		string = ''.join([s for x in range(n // len(s) + 1)])
		string = string[:n]
		solns.append(string)
	print('\n'.join(solns))
main()


t = int(input())
d = []
abc = list('abcdefghijklmnopqrstuvwxyz')
for i in range(0, t):
	b1 = input().split()
	n = int(b1[0])
	a = int(b1[1])
	b = int(b1[2])
	tringa = []
	for i in range(0, n):
		if i % a < b:
			resto = i % a % b
			tringa.append(abc[resto])
		else:
			tringa.append(abc[b - 1])
	stringa = ''
	for i in range(0, n):
		stringa = stringa + tringa[i]
	d.append(stringa)
for i in d:
	print(i)


import math
import sys
from collections import defaultdict
input = iter(sys.stdin.buffer.read().decode().splitlines()).__next__
ilele = lambda : map(int, input().split())
alele = lambda : list(map(int, input().split()))

def list2d(a, b, c):
	return [[c] * b for i in range(a)]

def list3d(a, b, c, d):
	return [[[d] * c for j in range(b)] for i in range(a)]
INF = 10 ** 18
MOD = 1000000000 + 7
A = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
for _ in range(int(input())):
	(n, a, b) = ilele()
	S = ''.join(A[:b])
	U = S * a
	UU = U[:a]
	T = UU * (n // a + 5)
	print(T[:n])


for ii in range(int(input())):
	p = [int(i) for i in input().split()]
	n = p[0]
	a = p[1]
	b = p[2]
	alpha = ['a']
	for i in range(1, 26):
		alpha.append(chr(ord('a') + i))
	s = ''
	for i in range(a - b + 1):
		s += 'a'
	for i in range(b - 1):
		s += alpha[i + 1]
	x = n // a
	y = n % a
	print(s * x + s[0:y])


totalCase = int(input())
for t in range(totalCase):
	line = input().rstrip().split()
	n = int(line[0])
	a = int(line[1])
	b = int(line[2])
	idx = 0
	if False:
		rep = int(n / 26)
		result = [chr(ord('a') + i) for i in range(n)]
	else:
		result = ['a'] * (a - b)
		offset = 0
		while len(result) < a:
			result.append(chr(ord('a') + offset))
			offset += 1
		while len(result) < n:
			result.append(result[idx])
			idx += 1
	print(''.join([i for i in result]))


for i in range(0, int(input())):
	(n, a, b) = [int(t) for t in input().split()]
	ch = 97
	c = 0
	for i in range(0, n):
		print(chr(ch + c), end='')
		c += 1
		if c == b or c == a:
			c = 0
	print('')


string = ''
for _ in range(int(input())):
	(n, a, b) = map(int, input().split())
	for i in range(97, 97 + b):
		string += chr(i)
	m = len(string)
	while m < n:
		for i in range(b):
			string += string[i]
			m = len(string)
			if m == n:
				break
		if m == n:
			break
	print(string)
	string = ''


t = input()
alpha = 'abcdefghijklmnopqrstuvwxyz'
t = int(t)
while t > 0:
	t = t - 1
	inpt = input()
	(n, a, b) = inpt.split(' ')
	n = int(n)
	a = int(a)
	b = int(b) if int(b) <= 26 else 26
	uniq = alpha[0:b]
	output = uniq
	r = n / len(output)
	m = n % len(output)
	output = output * int(r) + output[0:m]
	print(output)


for _ in range(int(input())):
	(n, a, b) = map(int, input().split())
	q = n // a
	r = n % a
	x = 'abcdefghijklmnopqrstuvwxyz'
	s = ''
	t = b
	for i in range(b):
		s += x[i]
	diff = a - b
	v = s[-1]
	for i in range(a - b):
		s += v
	s = s * q
	c = s[:r]
	s += c
	print(s)


t = int(input())
for _ in range(t):
	(n, a, b) = map(int, input().split())
	s = 'a' * (a - b + 1)
	w = 97
	if b == 1:
		s = 'a' * n
	else:
		for i in range(a - b + 1, a):
			s += chr(w + 1)
			w += 1
		q = a - b + 1
		w = 97
		z = 0
		for i in range(a, n):
			if w == 122:
				w = 96
			if q > 0:
				w = 97
				s += chr(w)
				q -= 1
			else:
				w += 1
				s += chr(w)
				z += 1
				if z == b - 1:
					q = a - b + 1
					z = 0
	print(s)


t = int(input())

def make_string(length, letter_count):
	dif = length - letter_count
	result = 'a' * dif
	for i in range(letter_count):
		result += chr(ord('a') + i)
	return result
for i in range(t):
	numbers = list(map(int, input().split()))
	n = numbers[0]
	a = numbers[1]
	b = numbers[2]
	ans = make_string(a, b)
	while len(ans) < n:
		ans += make_string(a, b)
	print(ans[:n])


from string import ascii_lowercase
chars = ascii_lowercase
for _ in range(int(input())):
	(n, a, b) = list(map(int, input().split()))
	print(''.join([chars[i % b] for i in range(n)]))


t = int(input())
str = 'abcdefghijklmnopqrstuvwxyz'
while t:
	(n, a, b) = map(int, input().split())
	res = ''
	while n > 0:
		if n > b:
			k = b
		else:
			k = n
		res += str[0:k:1]
		n -= b
	print(res)
	t -= 1


def position(arr):
	for i in range(len(arr)):
		if arr[i] != 0:
			return i
	return 0

def count1(arr):
	count = 0
	for i in range(len(arr)):
		if arr[i] != 0:
			count += 1
	return count
for test in range(int(input())):
	(n, a, b) = map(int, input().split())
	arr = [0] * 26
	ans = []
	b1 = b
	for i in range(a):
		if b1 > 0:
			arr[b1 - 1] += 1
			ans.append(chr(97 + b1 - 1))
			b1 -= 1
		else:
			pos = position(arr)
			ans.append(chr(97 + pos))
			arr[pos] += 1
	remove = 0
	while len(ans) != n:
		arr[ord(ans[remove]) - 97] -= 1
		if count1(arr) >= b:
			pos = position(arr)
			ans.append(chr(97 + pos))
			arr[pos] += 1
		else:
			pos = arr.index(0)
			ans.append(chr(97 + pos))
			arr[pos] += 1
		remove += 1
	print(''.join(ans))


t = int(input())
for _ in range(t):
	(n, a, b) = list(map(int, input().split()))
	s = 'abcdefghijklmnopqrstuvwxyz'
	res = s[:b]
	i = 1
	while i * b <= n:
		print(res, end='')
		i += 1
	print(s[:n - b * (i - 1)])


t = int(input())
for _ in range(t):
	(n, a, b) = map(int, input().split())
	ans = [0] * b
	count = 0
	for i in range(b):
		ans[i] = count
		count += 1
	val = a // b
	diff = a % b
	newans = []
	for i in range(val):
		newans = newans + ans
	newans = newans + ans[:diff]
	val = n // a
	diff = n % a
	finalans = []
	for i in range(val):
		finalans = finalans + newans
	finalans = finalans + newans[:diff]
	stringans = ''
	for i in finalans:
		stringans += chr(i + 97)
	print(stringans)


number_of_tests = int(input())
for _ in range(number_of_tests):
	(n, a, b) = tuple(map(int, input().split(' ')))
	s = ''
	for i in range(n):
		s += chr(97 + i % b)
	print(s)


t = int(input())
for k in range(t):
	arr = list(map(int, input().split(' ')))
	n = arr[0]
	a = arr[1]
	b = arr[2]
	b1 = []
	for i in range(0, b, 1):
		c = chr(97 + i)
		b1.append(c)
	s = ''
	i = 0
	while i < n:
		j = 0
		l = 0
		while i < n and j < a:
			if l == b:
				l = 0
			s = s + b1[l]
			l += 1
			i += 1
			j += 1
	print(s)


import math
from collections import Counter
L = lambda : list(map(int, input().split()))
M = lambda : map(int, input().split())
I = lambda : int(input())
IN = lambda : input()

def s(a):
	print(' '.join(list(map(str, a))))
w = 'abcdefghijklmnopqrstuvwxyz'
for i in range(int(input())):
	(n, a, b) = M()
	if b == 1:
		print('a' * n)
	else:
		print(w[:b] * (n // b) + w[:n % b])


def string_maker(c, d):
	result = 'a' * (c - d)
	for i1 in range(97, 97 + d):
		result += chr(i1)
	return result
testCases = int(input())
for _ in range(testCases):
	(length, a, b) = list(map(int, input().split()))
	sub_string = string_maker(a, b)
	x = length // a + 1
	y = x * sub_string
	print(y[0:length])


from sys import stdin, exit
input = stdin.readline

def i():
	return input()

def ii():
	return int(input())

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

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

def print_array(a):
	print(''.join(map(str, a)))
alphabet = [chr(i) for i in range(ord('a'), ord('z') + 1)]
t = ii()
for _ in range(t):
	(n, a, b) = iis()
	s = alphabet[:b]
	ans = []
	for i in range(n):
		ans.append(s[i % len(s)])
	print_array(ans)


t = int(input())
for _ in range(t):
	(n, a, b) = [int(i) for i in input().split()]
	ac = 1
	bc = 1
	c = 97
	answer = ''
	for i in range(n):
		if c > 122:
			c = 97
		if ac == a:
			ac = 1
			bc = 1
		answer += chr(c)
		ac += 1
		if bc != b:
			c += 1
			bc += 1
	print(answer)


def main():
	t = int(input())
	for i in range(t):
		(n, a, b) = map(int, input().split())
		s = ''
		for j in range(n):
			s += chr(ord('a') + j % b)
		print(s)
main()


from math import *
from copy import *
from heapq import *
from string import *
from random import *
from bisect import *
from sys import stdin
from sys import maxsize
from operator import *
from itertools import *
from collections import Counter
from collections import defaultdict

def solve(n, a, b):
	d = {}
	if b == 1:
		return 'a' * n
	if n == 1:
		return 'a'
	if a == 1:
		return 'a' * n
	ans = ''
	alpha = ascii_lowercase
	curr = 0
	ans = 'a' * (a - b + 1)
	curr = 1
	for i in range(a - len(ans)):
		ans += alpha[curr]
		curr += 1
	d = dict(Counter(ans))
	nn = len(ans)
	for i in range(nn, n):
		last = ans[i - a]
		ans += last
	return ans
T = int(input())
for _ in range(T):
	(n, a, b) = list(map(int, stdin.readline().rstrip().split()))
	print(solve(n, a, b))


import sys
from collections import defaultdict
import random
import math
t = 1
t = int(input())
for tc in range(1, t + 1):
	(n, k, c) = map(int, input().split())
	s = res = []
	for i in range(c):
		s.append(chr(97 + i))
	x = n // c
	x = (x + 1) * c
	j = 0
	for i in range(x):
		res.append(s[j])
		j += 1
		if j == len(s):
			j = 0
	print(''.join(res)[:n])


t = int(input())
chars = 'abcdefghijklmnopqrstuvwxyz'
for _ in range(t):
	(n, a, b) = map(int, input().split())
	s = chars[0] * (a - b + 1)
	for i in range(b - 1):
		s += chars[i + 1]
	result = s * (n // a) + s[:n % a]
	print(result)


t = int(input())
ans = []
for s in range(t):
	(n, a, b) = [int(x) for x in input().split()]
	str = []
	ori = 'a'
	alpha = ori
	if a == 1 and b == 1:
		for j in range(n):
			str.append(alpha)
			alpha = chr(ord(alpha) + 1)
			if ord(alpha) > 122:
				alpha = ori
	else:
		for i in range(n):
			str.append(alpha)
			alpha = chr(ord(alpha) + 1)
			if ord(alpha) - ord(ori) == b:
				alpha = ori
			if ord(alpha) > 122:
				alpha = ori
	ans.append(str)
for it in ans:
	print(*it, sep='')


from sys import stdin
t = int(stdin.readline())
for _ in range(t):
	(n, a, b) = map(int, stdin.readline().split())
	string = ''
	num = 0
	for i in range(n):
		string += chr(num + 97)
		num = (num + 1) % b
	print(string)


from math import ceil

def solve():
	t = int(input())
	for _ in range(t):
		(n, a, b) = map(int, input().split())
		s = ''
		count = n // a
		full = a // b
		pattern = ''
		for i in range(b):
			pattern += chr(97 + i)
		ptr = pattern * (n // b)
		s = ptr
		for i in range(n - len(ptr)):
			s += ptr[i]
		print(s)
solve()


q = int(input())
ans = []
for i in range(0, q):
	s = input()
	data = s.split()
	n1 = int(data[0])
	a1 = int(data[1])
	a2 = a1
	b1 = int(data[2])
	ll = 'abcdefghijklmnopqrstuvwxyz'
	st = ll[0:b1]
	t = 0
	s = ''
	gg = 0
	while t != n1:
		if gg < len(st):
			s += st[gg]
		else:
			gg = 0
			s += st[gg]
		gg += 1
		t += 1
	ans.append(s)
for k in range(0, q):
	print(ans[k])


from sys import stdin
input = stdin.readline

def A():
	for i in range(int(input())):
		print((int(input()) - 1) // 2)

def B():
	for _ in range(int(input())):
		(n, a, b) = map(int, input().split())
		s = 'abcdefghijklmnopqrstuvwxyz'[0:b] * (n // b + 1)
		print(s[0:n])
	return

def C():
	return

def D():
	return
B()


import string
t = input()
for i in range(int(t)):
	start = 96
	ss = input().split()
	n = int(ss[0])
	a = int(ss[1])
	b = int(ss[2])
	ans = ''
	l = list(string.ascii_lowercase)
	i = 0
	if a <= b:
		for k in range(n):
			ans += l[i % 26]
			i += 1
	else:
		for k in range(n):
			sub = 0
			ans += l[i % 26]
			i += 1
			if i == b:
				i = 0
	print(ans)


T = int(input())
for test in range(T):
	(n, a, b) = map(int, input().split())
	for i in range(n):
		print(chr(97 + i % b), end='')
	print()


t = int(input())
for _ in range(t):
	(n, a, b) = map(int, input().split())
	z = 97
	list = []
	for i in range(b):
		list.append(chr(z))
		z += 1
	string = ' '
	c = 0
	while c < n:
		j = c % b
		string = string + list[j]
		c += 1
	print(string)


t = int(input())
alp = 'abcdefghijklmnopqrstuvwxyz'
for loop in range(t):
	(n, a, b) = map(int, input().split())
	ans = []
	for i in range(n):
		ans.append(alp[i % b])
	print(''.join(ans))


def solve(n, a, b, ans):
	s = ''
	for i in range(a - b + 1):
		s += 'a'
	for i in range(b - 1):
		s += chr(ord('a') + i + 1)
	s *= n // len(s)
	req = n % len(s)
	for i in range(req):
		s += s[i]
	ans.append(s)

def main():
	t = int(input())
	ans = []
	for i in range(t):
		(n, a, b) = map(int, input().split())
		solve(n, a, b, ans)
	for i in ans:
		print(i)
main()


N = int(input())
for iteration in range(N):
	strlist = input().split(' ')
	n = int(strlist[0])
	a = int(strlist[1])
	b = int(strlist[2])
	result = ''
	for i in range(b):
		result += chr(97 + i)
	while len(result) < a:
		result += chr(97 + b - 1)
	finalResult = ''
	for i in range(int(n / a)):
		finalResult += result
	ptr = 0
	while len(finalResult) < n:
		finalResult += result[ptr]
		ptr += 1
	print(finalResult)


t = int(input())
M = []

def fonction(n, a, b):
	s = ''
	s1 = ''
	while len(s1) < a:
		for i in range(b):
			s1 += chr(97 + i)
			if len(s1) == a:
				break
	while len(s) < n:
		for i in range(len(s1)):
			s += s1[i]
			if len(s) == n:
				break
		s1 = s1[0] + s1[1:len(s1) - 1] + s1[len(s1) - 1]
	return s
for i in range(t):
	(n, a, b) = [int(x) for x in input().split()]
	M.append(fonction(n, a, b))
for k in M:
	print(k)


import string
t = int(input())
cases = []
for _ in range(t):
	(n, a, b) = [int(i) for i in input().split()]
	alp = list(string.ascii_lowercase)
	w = alp[:b] + (b - a) * [alp[b - 1]]
	print(''.join((w * (n // len(w) + 1))[:n]))


alphabet = 'abcdefghijklmnopqrstuvwxyz'

def answer(t):
	for i in range(t):
		(n, a, b) = map(int, input().split())
		s = ''
		temp = ''
		index = 0
		for i in range(n):
			if len(temp) == a:
				temp = temp[1:]
			if len(set(temp)) < b:
				s += alphabet[index]
				temp += alphabet[index]
				if index < 25:
					index += 1
				else:
					index = 0
			else:
				s += s[-1]
				temp += temp[-1]
		print(s)
answer(int(input()))


ab = 'abcdefghijklmnopqrstuvwxyz'
for _ in range(int(input())):
	(n, a, b) = map(int, input().split())
	s = ab[:b]
	while len(s) < n:
		s += ab[:b]
	print(s[:n])


import math
t = int(input())
for i in range(t):
	(n, a, b) = [int(i) for i in input().split()]
	s = ''
	for i in range(n):
		s += chr(i % b + ord('a'))
	print(s)


t = int(input())
for i in range(t):
	(a, b, c) = map(int, input().split())
	l = ['a'] * b
	x = chr(ord('a') + 1)
	for j in range(c - 1):
		l[j] = x
		x = chr(ord(x) + 1)
	while 1:
		if len(l) >= a:
			break
		l = l + l
	l = l[0:a]
	print(''.join(l))


t = int(input())
for i in range(t):
	(n, a, b) = list(map(int, input().split()))
	s = ''
	l = 'a'
	for i in range(n):
		s += l
		if ord(l) - ord('a') == b - 1 or l == 'z':
			l = 'a'
		else:
			l = chr(1 + ord(l))
	print(s)


ma = 'abcdefghijklmnopqrstuvwxyz'
for _ in range(int(input())):
	(n, a, b) = map(int, input().split())
	sam = ma[:b]
	for i in range(a - b):
		sam += 'a'
	ke = 0
	for j in range(a, n):
		sam += sam[ke]
		ke += 1
	print(sam)


t = int(input())
letters = 'qwertyuiopasdfghjklzxcvbnm'
for i in range(t):
	(n, a, b) = map(int, input().split())
	print(letters[0:b] * (n // b) + letters[0:n % b])


t = int(input())
letter = 'qwertyuiopasdfghjklzxcvbnm'
for i in range(t):
	inn = input().split()
	n = int(inn[0])
	a = inn[1]
	b = int(inn[2])
	for j in range(n):
		print(str(letter[j % b]), end='')
	print()


for _ in range(int(input())):
	(N, A, B) = map(int, input().split())
	S = ''
	for i in range(A - B + 1):
		S += 'a'
	for i in range(B - 1):
		S += chr(ord(S[-1]) + 1)
	count = A
	index = 0
	X = ''
	while count != N:
		X += S[index % A]
		index += 1
		count += 1
	print(S + X)


import string
t = int(input())
for _ in range(t):
	(n, a, b) = map(int, input().split())
	pt = string.ascii_lowercase[:b]
	pt *= int((n + a - 1) / a) * a
	print(pt[:n])


t = int(input())
for _ in range(t):
	s1 = list(map(int, input().split()))
	s = ''
	i = 0
	while i < s1[0]:
		j = 0
		while j < s1[2] and i < s1[0]:
			s = s + chr(ord('a') + j)
			i = i + 1
			j = j + 1
	print(s)


t = int(input())
for test in range(t):
	(n, a, b) = map(int, input().split())
	s = ''
	while len(s) < n:
		for i in range(b):
			s = s + chr(97 + i)
	print(s[:n])


N = int(input())
for _ in range(N):
	s = ''
	(n, a, b) = list(map(int, input().split()))
	for i in range(n):
		s += chr(ord('a') + i % b)
	print(s)


char = [chr(a) for a in range(97, 97 + 26)]
t = int(input())
while t != 0:
	[n, a, b] = list(map(int, input().split()))
	string = ''
	j = 0
	for i in range(a):
		string += chr(97 + j)
		if j + 1 != b:
			j += 1
		else:
			j = 0
	i = 0
	while len(string) != n:
		string += string[i]
		i += 1
	print(string)
	t -= 1


for _ in range(int(input())):
	(n, a, b) = map(int, input().split())
	(s, c) = ('', 0)
	for i in range(a - b + 1):
		s += 'a'
		c += 1
	i = 98
	while c < a:
		s += chr(i)
		c += 1
		i += 1
	x = n // a + 1
	s = s * x
	s = s[0:n]
	print(s)


import math
for t in range(int(input())):
	(n, a, b) = map(int, input().split())
	s = 'abcdefghijklmnopqrstuvwxyz'
	print(math.floor(n / b) * s[:b] + s[:n % b])


t = int(input())
for _ in range(t):
	(n, a, b) = map(int, input().split())
	alpha = 'a'
	l = []
	for i in range(0, 26):
		l.append(alpha)
		alpha = chr(ord(alpha) + 1)
	if b == 1:
		print('a' * n)
	else:
		temp = ''
		c = 0
		for i in range(len(l)):
			temp = temp + l[i]
			c = c + 1
			if c == b:
				break
		temp = temp + l[c - 1] * (a - b)
		res = temp * (n // a)
		x = n % a
		res = res + temp[0:x]
		print(res)


s = 'abcdefghijklmnopqrstuvwxyz'
v = int(input())
for _ in range(v):
	(a, x, y) = map(int, input().split())
	t = s[:y]
	t += t[-1] * (x - y)
	b = t * (a // x + 1)
	print(b[:a])


import sys
for _ in range(int(sys.stdin.readline().rstrip())):
	(n, a, b) = list(map(int, sys.stdin.readline().rstrip().split()))
	re = ''
	i = 0
	while True:
		re += chr(ord('a') + i)
		i = (i + 1) % b
		if len(re) == n:
			break
	print(re)


from sys import stdin, stdout
from sys import maxsize
input = stdin.readline

def solve():
	pass
test = 1
test = int(input().strip())
for t in range(0, test):
	(n, a, b) = list(map(int, input().strip().split()))
	x = list('abcdefghijklmnopqrstuvwxyz')
	s = ''
	for i in range(b):
		s += x[i]
	while len(s) < a:
		s += 'a'
	ans = ''
	while len(ans) < n:
		ans += s
	print(ans[:n])
	ans = solve()


import string
t = int(input())
for i in range(t):
	(n, a, b) = (int(col) for col in input().split(' '))
	distincts = string.ascii_lowercase[:b]
	substring_a = distincts * a
	print((substring_a * n)[:n])


def func(n, a, b):
	temp = ''
	for i in range(b):
		temp += chr(97 + i)
	res = temp
	div = (n - b) // b
	res += temp * div
	rem = n % b
	res += temp[:rem]
	print(res)
t = int(input())
for _ in range(t):
	(n, a, b) = map(int, input().split())
	func(n, a, b)


def subs(n, a, b):
	letters = ['q', 'w', 'e', 'r', 't', 'y', 'u', 'i', 'o', 'p', 'a', 's', 'd', 'f', 'g', 'h', 'j', 'k', 'l', 'z', 'x', 'c', 'v', 'b', 'n', 'm']
	usedletters = []
	for i in range(b):
		usedletters.append(letters[i])
	usedletters = usedletters * n
	mystring = ''
	for i in range(n):
		mystring += usedletters[i]
	return mystring
t = int(input())
for i in range(t):
	(n, a, b) = list(map(int, input().split()))
	print(subs(n, a, b))


for _ in range(int(input())):
	(n, a, b) = map(int, input().split())
	temp = ''
	ans = ''
	l = a
	for i in range(b):
		temp += chr(97 + i)
	l -= b
	while l > 0:
		temp += temp[b - 1]
		l -= 1
	ans += n // a * temp
	ans += temp[0:n % a]
	print(ans)


tests = int(input())
for i in range(tests):
	line = list(map(int, input().split()))
	string = ''
	for i in range(line[0]):
		string += chr(97 + i % line[2])
	print(string)


from itertools import cycle, islice
from collections import defaultdict
import heapq
import copy
import sys
stream = sys.stdin
t = int(stream.readline())
letters = 'qwertyuiopasdfghjklzxcvbnm'
for s in stream:
	(n, a, b) = s.split()
	n = int(n)
	a = int(a)
	b = int(b)
	cyc1 = islice(cycle(letters[:b]), a)
	print(''.join(list(islice(cycle(cyc1), n))))


t = int(input())
for i in range(t):
	n = list(map(int, input().split()))
	A = list('abcdefghijklmnopqrstuvwxyz')
	if (n[2] == 1) & (n[1] == 1):
		if n[0] > 26:
			b = []
			b.extend((n[0] // 26 + 1) * A)
			print(''.join(b[:n[0]]))
		else:
			print(''.join(A[:n[0]]))
	elif n[2] == 1:
		print(''.join(['a'] * n[0]))
	else:
		b = A[:n[2]]
		c = b.copy()
		b.extend(c * (n[0] // n[2] + 1))
		print(''.join(b[:n[0]]))


t = int(input())
for i in range(t):
	(a, b, n) = map(int, input().split())
	for i in range(a // b):
		for j in range(n):
			print(chr(97 + j), end='')
		print(chr(97 + j) * (b - n), end='')
	for j in range(min(a % b, n)):
		print(chr(97 + j), end='')
	for i in range(max(a % b - n, 0)):
		print(chr(97 + j), end='')
	print()


a = int(input())
alf = [i for i in 'abcdefghijklmnopqrstuvwxyz']
for i in range(a):
	(n, a, b) = [int(i) for i in input().split()]
	res = []
	for j in range(n):
		res.append(chr(ord('a') + j % b))
	print(*res, sep='')


t = int(input())
for i in range(t):
	(n, sub, dis) = map(int, input().split())
	ch = 96
	res = []
	arr = []
	for j in range(dis):
		ch = ch + 1
		res.append(chr(ch))
		arr.append(chr(ch))
	cop = sub - dis
	res = res + [chr(ch)] * cop
	arr = arr + [chr(ch)] * cop
	c = 0
	for j in range(sub, n):
		if c == sub:
			c = 0
		res.append(arr[c])
		c = c + 1
	print(''.join(res))


import string
check = string.ascii_lowercase
t = int(input())
result = []
for _ in range(t):
	(n, a, b) = list(map(int, input().split()))
	qty_start = n // b
	qty_end = n % b
	word = check[:b] * qty_start + check[:qty_end]
	result.append(word)
for res in result:
	print(res)


s = 'qwertyuiopasdfghjklzxcvbnm'
from sys import stdin
p = int(stdin.readline())
for i in range(p):
	z = ''
	(n, a, b) = map(int, stdin.readline().split())
	f = s[:b]
	if a >= b:
		x = n // b
		y = n % b
		for i in range(x):
			z += f
		z += f[:y]
	print(z)


def makeString(n, a, b):
	res = []
	arr = []
	A = a
	while a > 0:
		for i in range(97, 97 + b):
			arr.append(chr(i))
		a = a - b
	a = A
	arr = arr[:a]
	sN = n
	while n > 0:
		for i in range(len(arr)):
			res.append(arr[i])
		n -= a
	return res[:sN]
N = int(input())
for _ in range(N):
	(n, a, b) = map(int, input().split())
	print(''.join(makeString(n, a, b)))


t = int(input())
s = 'abcdefghijklomnpqrstuvwxyz'
for _ in range(t):
	(n, a, b) = map(int, input().split())
	print(''.join([s[i % b] for i in range(n)]))


t = int(input())
for o in range(t):
	(n, a, b) = [int(x) for x in input().split()]
	d = []
	ctra = 0
	while ctra < n:
		for i in range(0, b):
			d.append(chr(97 + i))
			ctra += 1
			if ctra == n:
				break
	print(*d, sep='')


t = int(input())
while t > 0:
	t -= 1
	(n, a, b) = [int(x) for x in input().split()]
	k = 96
	char = ''
	A = a
	B = b
	while n > 0:
		if B > 0:
			k += 1
			if k > 96 + 26:
				k = 97
			char += chr(k)
			B -= 1
			n -= 1
		else:
			for i in range(a - b):
				if n > 0:
					char += chr(k)
				else:
					break
				n -= 1
			B = b - 1
			if B == 0:
				for i in range(n):
					char += chr(k)
				break
	print(char)


for _ in range(int(input())):
	(n, a, b) = map(int, input().split())
	s = ''
	for i in range(b):
		s += chr(97 + i)
	if b == 1:
		s += s * (n - 1)
	else:
		s1 = s[:]
		s += s1[:a - b]
		i = 0
		while len(s) < n:
			s += s[i]
			i += 1
	print(s)


t = int(input())
for i in range(t):
	n = list(map(int, input().split()))
	s = []
	while len(s) <= n[0]:
		for j in range(97, 97 + n[2]):
			s.append(chr(j))
	print(*s[:n[0]], sep='')


import sys

def solve(n):
	(n, a, b) = [int(i) for i in n]
	ca = 0
	cb = 0
	ans = []
	for i in range(n):
		ans.append(chr(ord('a') + cb))
		cb = (cb + 1) % b
	print(''.join(ans))
count = 0
n_tests = 0
for line in sys.stdin:
	if n_tests == 0:
		n_tests = int(line)
	else:
		count += 1
		solve(line.strip().split(' '))
		if count == n_tests:
			break


t = int(input())
alpha = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
for x in range(t):
	(n, a, b) = map(int, input().split())
	nbocc = [0 for i in range(26)]
	s = ['a' for i in range(a)]
	for aj in range(1, b):
		s[aj] = alpha[aj]
	for i in range(n):
		j = i % a
		print(s[j], end='')
	print()


t = int(input())
for i in range(t):
	(n, a, b) = map(int, input().split())
	albt = list('abcdefghijklmnopqrstuvwxyz')
	c = 0
	ans = ''
	for j in range(n):
		ans = ans + albt[c]
		c += 1
		if c == b:
			c = 0
	print(ans)


import string
letters = string.ascii_lowercase
for _ in range(int(input())):
	(n, a, b) = map(int, input().split())
	x = (letters[:b] * a * n)[:n]
	print(x)


import heapq as hp

def unpack(func=int):
	return map(func, input().split())

def l_unpack(func=int):
	return list(map(func, input().split()))

def s_unpack(func=int):
	return sorted(map(func, input().split()))

def range_n():
	return range(int(input()))

def main():
	for i in range_n():
		(n, a, b) = unpack()
		ans = [None] * n
		for i in range(n):
			ans[i] = chr(97 + i % b)
		print(''.join(ans))
main()


from sys import stdin, stdout
input = stdin.readline
for _ in range(int(input())):
	x = 'abcdefghijklmnopqrstuvwxyz'
	(n, a, b) = map(int, input().split())
	s = x[:b] + (a - b) * x[b - 1]
	m = s * (n // a)
	m += s[:n % a]
	print(m)


alph = 'qwertyuiopasdfghjklzxcvbnm'
m = int(input())
while m > 0:
	s = input().split(' ')
	n = int(s[0])
	a = int(s[1])
	b = int(s[2])
	print((alph[0:b] * a * n)[0:n])
	m -= 1


for _ in range(int(input())):
	(n, a, b) = list(map(int, input().split()))
	for i in range(n):
		c = chr(ord('a') + i % b)
		print(c, end='')
	print()


from sys import stdin
for i in range(int(stdin.readline())):
	[n, a, b] = [int(x) for x in stdin.readline().split()]
	for i in range(n):
		print(chr(97 + i % b), end='')
	print('')


letters = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
cases = int(input())
values = []
i = 0
while i < cases:
	(a, b, c) = input().split()
	values.append(int(a))
	values.append(int(b))
	values.append(int(c))
	i = i + 1
n1 = 0
a1 = 1
b1 = 2

def form(n, a, b):
	string = letters[:b]
	len = b
	counter = 0
	while len < n:
		if counter == b:
			counter = 0
		string.append(letters[counter])
		counter = counter + 1
		len = len + 1
	str1 = ''
	print(str1.join(string))
t = 0
while t < cases:
	n = values[n1]
	n1 = n1 + 3
	a = values[a1]
	a1 = a1 + 3
	b = values[b1]
	b1 = b1 + 3
	form(n, a, b)
	t = t + 1


t = int(input())
for i in range(0, t):
	(x, y, z) = input().split()
	a = int(x)
	c = int(z)
	s = ''
	for i in range(0, a):
		h = int(i % c)
		s += chr(97 + h)
	print(s)


from string import ascii_lowercase
import math

def solve():
	(n, a, b) = map(int, input().split())
	s = ascii_lowercase[:b] + ascii_lowercase[b - 1] * (a - b)
	ans = s * math.ceil(n / a)
	print(ans[:n])
t = int(input())
for _ in range(t):
	solve()


from sys import stdin, stdout
from collections import defaultdict, Counter
from functools import lru_cache
from math import gcd, floor, ceil

def ilist():
	return [int(x) for x in stdin.readline().strip().split(' ')]

def iint():
	return int(stdin.readline().strip())

def istr():
	return stdin.readline().strip()
t = iint()
for _x in range(t):
	(n, a, b) = ilist()
	s = 'abcdefghijklmnopqrstuvwxyz'
	bstr = s[:b]
	res = bstr * (n // b)
	rem = n % b
	res = res + s[:rem]
	print(res)


import string
import random
alpha = list(string.ascii_lowercase)
n = int(input())
for i in range(n):
	(a, b, c) = list(map(int, input().split()))
	s = ''
	for j in range(c):
		s += alpha[j]
	print(s * (a // len(s)) + s[:a % len(s)])


t = int(input())
st = [chr(i) for i in range(98, 123)]
for _ in range(t):
	temp = [int(i) for i in input().split()]
	(n, a, b) = temp
	c = 0
	s = ''
	flag = True
	while flag:
		if n - c <= a - b:
			s += 'a' * (n - c)
			break
		else:
			s += 'a' * (a - b + 1)
			c += a - b + 1
		if c >= n:
			break
		for i in range(b - 1):
			s += st[i]
			c += 1
			if c >= n:
				flag = False
				break
	print(s)


total = int(input())
for _ in range(total):
	(n, a, b) = list(map(int, input().split()))
	alp = 'abcdefghijklmnopqrstuvwxyz'
	ans = (alp[:b] * (n // b + 1))[:n]
	print(ans)


def solve():
	(n, a, b) = [int(z) for z in input().split()]
	alphabet = 'abcdefghijklmnopqrstuvwxyz'
	s = alphabet[:b]
	i = 0
	while len(s) < a:
		s += s[-1]
	while len(s) < n:
		s += s[i]
		i += 1
	print(s)

def main():
	t = int(input())
	for i in range(t):
		solve()
main()


for _ in range(int(input())):
	(n, a, b) = map(int, input().split())
	l = 'abcdefghijklmnopqrstuvxwyz'
	fac = n // b
	rem = n % b
	s = l[:b] * fac + l[:rem]
	print(s)


for _ in range(int(input())):
	(n, a, b) = map(int, input().split(' '))
	r = [97 for i in range(a)]
	for i in range(b):
		r[i] += i
	r = [chr(i) for i in r]
	res = r * int(n / a) + r[:n % a]
	print(''.join(res))


for _ in range(int(input())):
	(n, a, b) = [int(x) for x in input().split()]
	c = 0
	s = ''
	for i in range(b):
		s += chr(c + ord('a'))
		c += 1
	c = 0
	for i in range(a - b):
		s += s[c]
	c = 0
	for i in range(n - a):
		s += s[c]
		c += 1
	print(s)


n = int(input())
alpha = 'abcdefghijklmnopqrstuvwxyz'
for i in range(n):
	(a, b, c) = map(int, input().split())
	sub = alpha[:c]
	res = sub * a
	res = res[:a]
	print(res)


t = int(input())
for _ in range(t):
	(n, b, a) = map(int, input().split())
	s = 'abcdefghijklmnopqrstuvwxyz'
	main = s[:a]
	ans = main * int(n / len(main))
	for i in range(a):
		if len(ans) == n:
			break
		else:
			ans += main[i]
	print(ans)


s = 'abcdefghijklmnopqrstuvwxyz'
for _ in range(int(input())):
	(n, a, b) = map(int, input().split())
	req = s[:b]
	req = req + req[-1] * (a - b)
	l = len(req)
	t = n // l
	ans = req * t
	l = len(ans)
	i = 0
	while l < n:
		ans += req[i]
		i += 1
		l += 1
	print(ans)


t = int(input())
al = []
for i in range(97, 123):
	al.append(chr(i))
for _ in range(t):
	(n, a, b) = map(int, input().split())
	s = ''
	for i in range(b):
		s += al[i]
	c = a // b
	d = a % b
	k = s
	s = s * c
	for i in range(d):
		s += k[i]
	u = 0
	while n - len(s) > 0:
		s += s[u]
		u += 1
	print(s)


a = int(input())
for _ in range(a):
	m = 'abcdefghijklmnopqrstuvwxyz'
	(b, c, d) = map(int, input().split())
	l = b // d + 1
	print((m[:d] * l)[:b])


T = int(input())
for i in range(T):
	(n, a, b) = list(map(int, input().split()))
	s = ''
	f = 1
	for j in range(a):
		s += chr(96 + f)
		if f == b:
			f = 0
		f += 1
	ti = n // a + 1
	ans = ''
	for j in range(ti):
		ans += s
	print(ans[0:n])


import math
for _ in range(int(input())):
	(n, a, b) = map(int, input().split())
	al = 'abcdefghijklmnopqrstuvwxyz'
	b_string = al[:b]
	s = n // b * b_string + b_string[:n % b]
	print(s)


test_cases = eval(input())
for i in range(test_cases):
	(length_string, length_substring, distinct) = list(map(int, input().split()))
	counter = 0
	item = [0] * length_string
	for c in 'abcdefghijklmnopqrstuvwxyz':
		if distinct == counter:
			break
		else:
			item[counter] = c
			counter += 1
	for j in range(distinct, length_string):
		item[j] = item[j - distinct]
	print(''.join(item))


import string
for _ in [0] * int(input()):
	(n, a, b) = map(int, input().split())
	print(((string.ascii_lowercase[:b] + 'a' * (a - b)) * n)[:n])


s = 'abcdefghijklmnopqrstuvwxyz'
t = int(input())
while t > 0:
	t -= 1
	(n, a, b) = map(int, input().split())
	if n % b == 0:
		print(n // b * s[0:b])
	else:
		print(n // b * s[0:b] + s[0:b][0:n % b])


import random
import string
n = int(input())
for i in range(n):
	(n, a, b) = map(int, input().split())
	s = ''
	lst = [random.choice(string.ascii_lowercase)]
	while b > len(lst):
		c = random.choice(string.ascii_lowercase)
		if c not in lst:
			lst.append(c)
	while len(s) <= a:
		s += ''.join(lst)
	s = s[:a]
	for j in range(a, n):
		s += s[j - a]
	print(s)


import sys
input = sys.stdin.readline
from collections import *
t = int(input())
alpha = 'abcdefghijklmnopqrstuvwxyz'
for _ in range(t):
	(n, a, b) = map(int, input().split())
	alp = alpha[:b]
	ans = []
	for i in range(n):
		ans.append(alp[i % b])
	print(''.join(ans))


for _ in range(int(input())):
	(n, a, b) = list(map(int, input().split()))
	data = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
	ans = ''
	for q in range(b):
		ans += data.pop()
	temp = a - b
	for q in range(temp):
		ans += ans[-1]
	temp = (n - a) // a + 1
	sample = ans
	ans *= temp
	count = 0
	for q in range(len(ans), n):
		ans += sample[count]
		count += 1
	print(ans)


import sys
import math
import os
import itertools
import string
import heapq
import _collections
from collections import Counter
from collections import defaultdict
from functools import lru_cache
import bisect
import re
import queue
from decimal import *

class Scanner:

	@staticmethod
	def int():
		return int(sys.stdin.readline().rstrip())

	@staticmethod
	def string():
		return sys.stdin.readline().rstrip()

	@staticmethod
	def map_int():
		return [int(x) for x in Scanner.string().split()]

	@staticmethod
	def string_list(n):
		return [input() for i in range(n)]

	@staticmethod
	def int_list_list(n):
		return [Scanner.map_int() for i in range(n)]

	@staticmethod
	def int_cols_list(n):
		return [int(input()) for i in range(n)]

class Math:

	@staticmethod
	def gcd(a, b):
		if b == 0:
			return a
		return Math.gcd(b, a % b)

	@staticmethod
	def lcm(a, b):
		return a * b // Math.gcd(a, b)

	@staticmethod
	def divisor(n):
		res = []
		i = 1
		for i in range(1, int(n ** 0.5) + 1):
			if n % i == 0:
				res.append(i)
				if i != n // i:
					res.append(n // i)
		return res

	@staticmethod
	def round_up(a, b):
		return -(-a // b)

	@staticmethod
	def is_prime(n):
		if n < 2:
			return False
		if n == 2:
			return True
		if n % 2 == 0:
			return False
		d = int(n ** 0.5) + 1
		for i in range(3, d + 1, 2):
			if n % i == 0:
				return False
		return True

def pop_count(x):
	x = x - (x >> 1 & 6148914691236517205)
	x = (x & 3689348814741910323) + (x >> 2 & 3689348814741910323)
	x = x + (x >> 4) & 1085102592571150095
	x = x + (x >> 8)
	x = x + (x >> 16)
	x = x + (x >> 32)
	return x & 127
MOD = int(1000000000.0) + 7
INF = int(1000000000000000.0)

def solve():
	(N, A, B) = Scanner.map_int()
	S = string.ascii_lowercase[:B] * (N // B) + string.ascii_lowercase[:N % B]
	print(S)

def main():
	T = Scanner.int()
	for _ in range(T):
		solve()
main()


m = int(input())
alpha = 'abcdefghijklmnopqrstuvwxyz'
for i in range(m):
	seq = input()
	A = seq.split()
	n = int(A[0])
	a = int(A[1])
	b = int(A[2])
	print(n // b * alpha[:b] + alpha[:n % b])


import math
for _ in range(int(input())):
	(n, a, b) = map(int, input().split())
	s = ''
	c = 0
	for i in range(n):
		s += chr(i % b + 97)
	print(s)


def main():
	for _ in range(int(input())):
		(n, a, b) = map(int, input().split())
		result = ('qwertyuiopasdfghjklzxcvbnm'[:b] * n)[:n]
		print(result)
main()


def main():
	OFS = 97
	for __ in [0] * int(input()):
		(n, a, b) = map(int, input().split())
		k = 0
		text = []
		for _ in range(a):
			text.append(chr(OFS + k))
			if k < b - 1:
				k += 1
		q = n // a
		r = n % a
		ans = [''.join(text)] * q + text[:r]
		ans = ''.join(ans)
		print(ans)
main()


for _ in range(int(input())):
	(n, a, b) = map(int, input().split())
	s = a - b
	st = ''
	ans = ''
	alpha = 'abcdefghijklmnopqrstuvwxyz'
	ans = alpha[:b]
	j = 0
	while j < n:
		st += ans[j % b]
		j += 1
	print(st)


for _ in range(int(input())):
	(n, a, b) = map(int, input().split())
	arr = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
	repeat = ''.join(arr[:b])
	ct = b
	s = repeat
	i = 1
	while ct < n:
		if i % b == 0:
			s += repeat[b - 1]
		else:
			s += repeat[i % b - 1]
		i += 1
		ct += 1
	print(s)


def main():
	T = int(input())
	s = 'abcdefghijklmnopqrstuvwxyz'
	for _ in range(T):
		(N, A, B) = map(int, input().split())
		ans = ('a' * (A - B + 1) + s[1:B]) * (N // A)
		if N % A <= A - B + 1:
			ans += 'a' * (N % A)
		else:
			ans += 'a' * (A - B + 1) + s[1:N % A - (A - B + 1) + 1]
		print(ans)
main()


from math import *
from copy import *
from string import *
from random import *
from sys import stdin
from sys import maxsize
from operator import *
from itertools import *
from collections import Counter
import math
t = int(input())
for i in range(t):
	(n, a, b) = map(int, input().split(' '))
	s = ''
	v = 97
	for j in range(b):
		s = s + chr(v)
		v = v + 1
	val = n // b
	val = val - 1
	temp = s
	while val != 0:
		s = s + temp
		val = val - 1
	mo = n % b
	for j in range(mo):
		s = s + temp[j:j + 1]
	print(s)


z = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
for t in range(int(input())):
	(n, k, m) = input().split()
	(n, k, m) = (int(n), int(k), int(m))
	(i, Z) = (-1, '')
	Z = ''.join(z[:m])
	if k > m:
		Z += Z * (k - m)
	Z = Z[:k]
	while i < n - k:
		if i == -1:
			print(Z, end='')
		else:
			print(Z[i % k], end='')
		i += 1
	print()


t = int(input())

def repeat(a, b, z, x):
	for i in range(0, b):
		x.append(z[i])
		a = a - 1
		if a == 0:
			break
	if a != 0:
		repeat(a, b, z, x)
	return x

def solve(n, a, b):
	z = []
	x = []
	y1 = []
	for i in range(0, b):
		z.append(chr(97 + i))
	m = repeat(a, b, z, x)
	y = repeat(n, a, m, y1)
	x1 = ''
	x1 = x1.join(y)
	print(x1)
while t > 0:
	y = input()
	b = [int(x) for x in y.split()]
	n = b[0]
	a = b[1]
	b = b[2]
	solve(n, a, b)
	t = t - 1


for _ in range(int(input())):
	(n, a, b) = list(map(int, input().split()))
	alpha = 'abcdefghijklmnopqrstuvwxyz'
	answer = ''
	if a == b:
		if n <= 26:
			print(alpha[:n])
		else:
			while len(answer) != n:
				for char in alpha:
					if len(answer) != n:
						answer += char
					else:
						break
			print(answer)
	else:
		answer = 'a' * (a - b) + alpha[:b]
		current = 0
		while len(answer) != n:
			if len(set(answer[current + 1:])) == b:
				answer += answer[current + 1]
				current += 1
			else:
				for char in alpha:
					if char not in answer[current + 1:]:
						answer += char
					break
		print(answer)


t = int(input())
for tt in range(t):
	letters = 'abcdefghijklmnopqrstuvwxyz'
	(n, a, b) = (int(i) for i in input().split())
	ans = []
	for i in range(n):
		ans.append(letters[i % b])
	print(''.join(ans))


tests = int(input())
while tests > 0:
	tests -= 1
	(n, a, b) = map(int, input().split())
	res = ['.'] * n
	cur = 'a'
	for i in range(0, n):
		if i % b == 0:
			cur = 'a'
		res[i] = cur
		cur = chr(ord(cur) + 1)
	for ch in res:
		print(ch, end='')
	print()


for _ in range(int(input())):
	number = 97
	(n, a, b) = map(int, input().split())
	listy = ['a'] * n
	numb = 0
	for i in range(n):
		listy[i] = chr(number + numb % b)
		numb += 1
	print(*listy, sep='')


t = int(input())
for _ in range(t):
	(n, a, b) = tuple(map(int, input().split()))
	s = []
	alpha = 'a'
	for i in range(b):
		s.append(chr(ord(alpha) + i))
	for i in range(b + 1, a + 1):
		s.append(chr(ord(alpha) + b - 1))
	count = 0
	for i in range(a, n):
		bet = s[count]
		s.append(bet)
		count += 1
	s = ''.join(s)
	print(s)


cases = int(input())
s = 'abcdefghijklmnopqrstuvwxyz'
for case in range(cases):
	(l, a, b) = list(map(int, input().split()))
	print((s[:b] * (l // b + 1))[:l])


i = int(input())
A = 'qwertyuiopasdfghjklzxcvbnm'
for x in range(i):
	(n, a, b) = input().split()
	n = int(n)
	a = int(a)
	b = int(b)
	S = A[:b]
	m = n // b
	ost = n % b
	S_int = S * m + S[:ost]
	print(S_int)


def func(n):
	letters = 'abcdefghijklmnopqrstuvwxyz'
	for i in range(n):
		ans = ''
		k = list(map(int, input().split()))
		length = k[0]
		unique = letters[:k[2]]
		lenght_substring = k[1]
		ans += unique * (length // len(unique))
		i = 0
		while len(ans) != length:
			ans += unique[i]
			i += 1
		print(ans)
n = int(input())
func(n)


l = [chr(x) for x in range(97, 123)]
l = ''.join(l)
for _ in range(int(input())):
	(n, a, b) = map(int, input().strip().split())
	j = l[:b]
	s = ''
	for x in range(n // b + 1):
		s += j
	print(s[:n])


abeceda = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'.lower()
for _ in range(int(input())):
	(N, A, B) = input().strip().split()
	(N, A, B) = (int(N), int(A), int(B))
	s = abeceda[:B]
	for _ in range(A - len(s)):
		s += s[-1]
	end_s = ''
	for i in range(N):
		end_s += s[i % A]
	print(end_s)


s = 'abcdefghijklmnopqrstuvwxyz'
for _ in range(int(input())):
	(a, b, c) = map(int, input().split())
	n = s[0:c]
	ans = str()
	ct = 0
	while 1:
		for i in range(c):
			ans += n[i]
			ct += 1
			if ct == a:
				break
		if ct == a:
			break
	print(ans)


first = ord('a')
alpha = [chr(i) for i in range(first, first + 26)]
t = int(input())
out = list()
for item in range(t):
	nab = input().split()
	n = int(nab[0])
	a = int(nab[1])
	b = int(nab[2])
	word = ''
	temp = ''
	if a == b:
		for k in range(26):
			temp += alpha[k]
		time = int(n / 26)
		word = temp * time
		rem = n - 26 * time
		for j in range(rem):
			word += alpha[j]
	elif b == 1:
		word = alpha[0] * n
	elif b < a:
		for k in range(b):
			temp += alpha[k]
		time = int(n / b)
		word = temp * time
		rem = n - b * time
		for j in range(rem):
			word += alpha[j]
	out.append(word)
for item in out:
	print(item)


import sys
import math
input = sys.stdin.readline

def inp():
	return int(input())

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

def insr():
	s = input()
	return list(s[:len(s) - 1])

def invr():
	return map(int, input().split())
anzahl_tests = inp()
for i in range(anzahl_tests):
	(lange, lange2, anzahl) = map(int, input().split(' '))
	letters = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
	fertig = False
	lauf = 0
	solution = ''
	while fertig == False:
		letters2 = letters[0:anzahl]
		solution = solution + letters2[lauf]
		lauf += 1
		if lauf == lange2 or lauf == anzahl:
			lauf = 0
		if len(solution) == lange:
			fertig = True
			print(str(solution))


def solve():
	l = 'abcdefghijklmnopqrstuvwxyz'
	for i in range(int(input())):
		(n, a, b) = map(int, input().split())
		ans = l[:b] * n
		print(ans[:n])
solve()


for i in range(int(input())):
	(n, a, b) = map(int, input().split())
	s = ''
	for i in range(97, 97 + b):
		s += chr(i)
	s += (a - b) * s[-1]
	l = len(s)
	s = s * (n // l + 1)
	print(s[:n])


t = int(input())
s = 'qwertyuiopasdfghjklzxcvbnm'
for i in range(t):
	(n, a, b) = map(int, input().split())
	q = []
	if a < b:
		print(0)
	else:
		for j in range(b):
			q.append(s[j])
		if b < a:
			for j in range(a - b):
				q.append(s[b - 1])
		for j in range(n - a):
			q.append(q[j])
		print(''.join(q))


import string
t = int(input())
alph = string.ascii_letters[:26]
for i in range(t):
	(n, a, b) = map(int, input().split())
	print((alph[:b] * (n // b + 1))[:n])


from bisect import *
from collections import *
from itertools import *
import functools
import sys
import math
from decimal import *
from copy import *
from heapq import *
from fractions import *
getcontext().prec = 30
MAX = sys.maxsize
MAXN = 1000010
MOD = 10 ** 9 + 7
spf = [i for i in range(MAXN)]
spf[0] = spf[1] = -1

def sieve():
	for i in range(2, MAXN, 2):
		spf[i] = 2
	for i in range(3, int(MAXN ** 0.5) + 1):
		if spf[i] == i:
			for j in range(i * i, MAXN, i):
				if spf[j] == j:
					spf[j] = i

def fib(n, m):
	if n == 0:
		return [0, 1]
	else:
		(a, b) = fib(n // 2)
		c = a % m * (b % m * 2 - a % m) % m
		d = a % m * (a % m) % m + b % m * b % m % m
		if n % 2 == 0:
			return [c, d]
		else:
			return [d, c + d]

def charIN(x=' '):
	return sys.stdin.readline().strip().split(x)

def arrIN(x=' '):
	return list(map(int, sys.stdin.readline().strip().split(x)))

def ncr(n, r):
	num = den = 1
	for i in range(r):
		num = num * (n - i) % MOD
		den = den * (i + 1) % MOD
	return num * pow(den, MOD - 2, MOD) % MOD

def flush():
	return sys.stdout.flush()
for _ in range(int(input())):
	(n, a, b) = arrIN()
	s = ''
	for i in range(n):
		s += chr(ord('a') + i % b)
	print(s)


from sys import stdin
from collections import deque
from math import sqrt, floor, ceil, log, log2, log10, pi, gcd, sin, cos, asin

def ii():
	return int(stdin.readline())

def fi():
	return float(stdin.readline())

def mi():
	return map(int, stdin.readline().split())

def fmi():
	return map(float, stdin.readline().split())

def li():
	return list(mi())

def lsi():
	x = list(stdin.readline())
	x.pop()
	return x

def si():
	return stdin.readline()
res = ['YES', 'NO']
let = [chr(i) for i in range(97, 123)]

def main():
	(n, a, b) = mi()
	x = n // b
	z = n % b
	ans = let[:b] * x
	ans += let[:z]
	print(*ans, sep='')
	return
for _ in range(ii()):
	main()


import os.path
from math import gcd, floor, ceil
from collections import *
import sys
mod = 1000000007
INF = float('inf')

def st():
	return list(sys.stdin.readline().strip())

def li():
	return list(map(int, sys.stdin.readline().split()))

def mp():
	return map(int, sys.stdin.readline().split())

def inp():
	return int(sys.stdin.readline())

def pr(n):
	return sys.stdout.write(str(n) + '\n')

def prl(n):
	return sys.stdout.write(str(n) + ' ')
if os.path.exists('input.txt'):
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')

def solve():
	(n, a, b) = mp()
	ans = []
	for i in range(b):
		ans.append(chr(97 + i))
	for i in range(b, a):
		ans.append('a')
	for i in range(a, n):
		ans.append(ans[i - a])
	print(*ans, sep='')
for _ in range(inp()):
	solve()


def solve(n, a, b):
	letters = ''.join([chr(ord('a') + i) for i in range(b)])
	if b < a:
		diff = a - b
		letters = letters + 'a' * diff
	(d, r) = divmod(n, a)
	return letters * d + letters[:r]
for _ in range(int(input())):
	(n, a, b) = map(int, input().split())
	print(solve(n, a, b))


t = int(input())
strr = 'abcdefghijklmnopqrstuvwxyz'
while t:
	(n, a, b) = map(int, input().split())
	seed = ''
	for i in range(b):
		seed += strr[i % 26]
	rem = n % b
	div = n // b
	ans = ''
	ans += seed * div + seed[:rem]
	print(ans)
	t -= 1


def problem(n, a, b):
	x = 'abcdefghijklmnopqrstuvwxyz'
	return ((x[:b] + x[b - 1] * (a - b)) * (n // a + 1))[:n]
for _ in range(int(input())):
	(n, a, b) = map(int, input().split())
	print(problem(n, a, b))


from collections import Counter, defaultdict, deque
t = int(input())
look = 'qwertyuiopasdfghjklzxcvbnm'
for i in range(t):
	(n, a, b) = [int(x) for x in input().split()]
	rep = look[:b]
	ans = (rep * n)[:n]
	print(ans)


import math
for _ in range(int(input())):
	list = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
	zli = ''
	(no, au, bu) = map(int, input().split())
	xom = no // au
	rem = no - xom * au
	i = 0
	for i in range(bu - 1):
		zli = zli + list[i]
	lo = au - bu
	zli = zli + list[i + 1] * (lo + 1)
	ans = zli * xom
	ans = ans + zli[:rem]
	print(ans)


from bisect import bisect_left as bl
from bisect import bisect_right as br
from heapq import heappush, heappop
import math
from collections import *
from functools import reduce, cmp_to_key
import sys
input = sys.stdin.readline
M = mod = 998244353

def factors(n):
	return sorted(set(reduce(list.__add__, ([i, n // i] for i in range(1, int(n ** 0.5) + 1) if n % i == 0))))

def inv_mod(n):
	return pow(n, mod - 2, mod)

def li():
	return [int(i) for i in input().rstrip('\n').split()]

def st():
	return input().rstrip('\n')

def val():
	return int(input().rstrip('\n'))

def li2():
	return [i for i in input().rstrip('\n')]

def li3():
	return [int(i) for i in input().rstrip('\n')]
s = 'abcdefghijklmnopqrstuvwxyz'
for _ in range(val()):
	(n, a, b) = li()
	temp = s[:b] * 3000
	print(temp[:n])


STRINGS = 'abcdefghijklmnopqrstuvwxyz'
for _ in range(int(input())):
	(n, a, b) = list(map(int, input().split()))
	result = STRINGS[:b] * (n // b + 1)
	print(result[:n])


t = int(input())
chars = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']

def solve(n, a, b):
	final = ''
	flag = True
	while flag:
		for i in range(b):
			final += chars[i]
			if len(final) >= n:
				flag = False
				break
	return final
for _ in range(t):
	(n, a, b) = list(map(int, input().split()))
	print(solve(n, a, b))


a = int(input())
for i in range(a):
	(n, a, b) = map(int, input().split())
	count = 0
	t = ''
	while count < b:
		t += chr(97 + count)
		count += 1
	if n % b == 0:
		r = n // b
		print(t * r)
	else:
		r = n // b + 1
		q = t * r
		print(q[0:n])


from sys import stdin
t = int(stdin.readline())
c = 'abcdefghijklmnopqrstuvwxyz'
for _ in range(t):
	(n, a, b) = map(int, stdin.readline().split())
	s = []
	p = 0
	for i in range(n):
		if len(s) < a:
			g = set(s)
			if len(g) < b:
				s += [c[p]]
				p = (p + 1) % 26
			else:
				s += [s[-1]]
		else:
			g = set(s[i - a + 1:i])
			if len(g) < b:
				s += [c[p]]
				p = (p + 1) % 26
			else:
				s += [s[-1]]
	print(''.join(s))


from math import ceil
import string
s = string.ascii_lowercase
t = int(input())
for _ in range(t):
	(n, a, b) = map(int, input().split())
	k = s[:b]
	k = k + k[::-1]
	u = ceil(a / b)
	y = k * u
	p = y[:a]
	o = ceil(n / a)
	p = p * o
	print(s[0] * n) if b == 1 else print(p[:n])


def findString(n, k):
	res = ''
	for i in range(k):
		res = res + chr(ord('a') + i)
	count = 0
	for i in range(n - k):
		res = res + chr(ord('a') + count)
		count += 1
		if count == k:
			count = 0
	return res

def main():
	for _ in range(int(input())):
		(n, a, b) = map(int, input().split())
		print(findString(n, b))
main()


alpha = 'abcdefghijklmnopqrstuvwxyz'
T = int(input())
for t in range(T):
	(N, A, B) = [int(x) for x in input().split()]
	our = alpha[:B]
	thestr = ''
	while len(thestr) < N:
		thestr += our
	print(thestr[:N])


def dist(h):
	l = 'a'
	for i in range(h):
		l = l + chr(97 + i)
	return l[1:len(l)]
for _ in range(int(input())):
	(a, b, c) = map(int, input().split())
	string = 'a'
	k = dist(c)
	for _ in range(int(a / c) + 1):
		string = string + k
	print(string[1:a + 1])


t = int(input())
ans = []
for g in range(t):
	(n, a, b) = map(int, input().split())
	q = []
	for i in range(b):
		q += [chr(97 + i)]
	z = ''.join(map(str, q))
	w = z * (n // b) + z[:n - n // b * b]
	ans.append(w)
for i in ans:
	print(i)


import sys
t = int(sys.stdin.readline())
s = 'abcdefghijklmnopqrstuvwxyz'
ans_arr = []
for i in range(t):
	[n, a, b] = [int(x) for x in sys.stdin.readline().split()]
	arr = []
	dist = 0
	ind = 0
	d = {}
	for h in range(a):
		if dist < b:
			arr.append(s[ind])
			d[s[ind]] = 1
			ind = (ind + 1) % 26
			dist += 1
		else:
			arr.append(arr[-1])
			d[arr[-1]] += 1
	last = 0
	for e in range(n - a):
		d[arr[last]] -= 1
		if d[arr[last]] == 0:
			arr.append(s[ind])
			d[s[ind]] = 1
			ind = (ind + 1) % 26
		else:
			arr.append(arr[-1])
			d[arr[-1]] += 1
		last += 1
	ans_arr.append(''.join(arr))
print('\n'.join(ans_arr))


import itertools
import string
import math
n = int(input())
ALPHABET = string.ascii_lowercase
for _ in range(n):
	(n, a, b) = (int(x) for x in input().split())
	generated_str = ''
	for __ in range(0, math.ceil(n / a)):
		tmp_str = ''
		for ___ in range(0, math.ceil(a / b)):
			tmp_str += ALPHABET[:b]
		tmp_str = tmp_str[:a]
		generated_str += tmp_str
	print(generated_str[:n])


def main():
	t = int(input())
	for i in range(t):
		(n, a, b) = tuple(map(int, input().split()))
		current_letter = 0
		str_result = [chr((current_letter + i) % b + 97) for i in range(n)]
		print(''.join(str_result))
main()


t = int(input())
for i in range(t):
	(n, a, b) = map(int, input().split())
	l2 = []
	count = 0
	l1 = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
	for j in range(n):
		if count <= b - 1:
			l2.append(l1[count])
			count = count + 1
		else:
			count = 0
			l2.append(l1[count])
			count = count + 1
	print(''.join(l2))


inp = lambda cast=int: [cast(x) for x in input().split()]
printf = lambda s='', *args, **kwargs: print(str(s).format(*args), flush=True, **kwargs)
(t,) = inp()
for _ in range(t):
	(n, a, b) = inp()
	s = ''
	while len(s) < n:
		for i in range(b):
			s += chr(ord('a') + i)
			if len(s) == n:
				break
	print(s)


import sys, collections

def get_ints():
	return map(int, sys.stdin.readline().strip().split())

def get_array():
	return list(map(int, sys.stdin.readline().strip().split()))

def input():
	return sys.stdin.readline().strip()
mod = 1000000007
for _ in range(int(input())):
	(n, a, b) = get_ints()
	s = ''
	ab = 'abcdefghijklmnopqrstuvwxyz'
	abc = list(ab)
	s += (ab[:b] * n)[:n]
	print(s)


t = int(input())
while t > 0:
	s = 'abcdefghijklmnopqrstuvwxyz'
	(n, a, b) = map(int, input().split())
	string = s[:b]
	number = n // len(string)
	extra = n % len(string)
	r = string * number + string[:extra]
	print(r)
	t -= 1


t = int(input())
alfa = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
result = []

def fun(lista):
	s = ''
	n = lista[0]
	a = lista[1]
	b = lista[2]
	while len(s) < n:
		for i in range(b):
			if len(s) < n:
				s += alfa[i]
	return s
for i in range(t):
	linha = [int(i) for i in input().split()]
	result.append(fun(linha))
for i in range(len(result)):
	print(result[i])


from sys import stdin, stdout
q = int(input())
for i in range(q):
	l = []
	for i in range(97, 98 + 25):
		l.append(chr(i))
	(n, a, b) = list(map(int, stdin.readline().split()))
	s = ''
	s1 = ''
	k = min(26, b)
	for i in range(k - 1):
		s = s + l[i]
	s = s + l[k - 1] * (a - b + 1)
	rem = n % a
	d = n // a
	s1 = s * d + s[:rem]
	print(s1)


t = int(input())
for i in range(t):
	(n, a, b) = [int(x) for x in input().split()]
	st = ''
	idx = 97
	for i in range(b):
		st += chr(idx)
		idx += 1
	mul = n // b
	st = st * mul
	rem = n - len(st)
	st += st[0:rem]
	print(st)


t = int(input())
for _ in range(0, t):
	all = [chr(i) for i in range(97, 97 + 26)]
	(n, a, b) = map(int, input().split())
	ss = ''
	for i in range(0, n):
		ss += all[i % b]
	print(ss)


t = int(input())
alph = 'abcdefghijklmnopqrstuvwxyz'
while t:
	(n, a, b) = map(int, input().split())
	st = alph[:b] * int(n / b)
	st += alph[:int(n % b)]
	print(st)
	t -= 1


for _ in range(int(input())):
	(n, a, b) = map(int, input().split())
	s = [0 for i in range(n)]
	v = 1
	for i in range(n):
		s[i] = (1 + v) % b
		s[i] += 97
		s[i] = chr(s[i])
		v = v + 1
		v = v % b
	string = ''.join(s)
	print(string)


t = int(input())
for i in range(t):
	str = ''
	(n, m, b) = [int(a) for a in input().split()]
	for j in range(n):
		str += chr(j % b + ord('a'))
	print(str)


T = int(input())
for t in range(T):
	(n, a, b) = map(int, input().split())
	if a == 1 or b == 1:
		string = ['a'] * n
		print(''.join(string))
	else:
		string = []
		for i in range(n):
			if i < b:
				string.append(chr(ord('a') + i))
			else:
				string.append(string[i - b])
		print(''.join(string))


t = int(input())
l = list('abcdefghijklmnopqrstuvwxyz')
for i in range(t):
	(n, a, b) = map(int, input().split())
	for j in range(n):
		print(l[j % b], end='')
	print()


from sys import stdin
t = int(stdin.readline())
while t > 0:
	s = 'abcdefghijklmnopqrstuvwxyz'
	s1 = []
	s1 = ''.join(s)
	a = [int(x) for x in stdin.readline().split()]
	n = a[0]
	l = a[1]
	d = a[2]
	b = ''
	div = n // d
	for i in range(div):
		b += s[0:d]
	diff = n - d * div
	if diff != 0:
		b += s[0:diff]
	print(b)
	t -= 1


import math
t = int(input())
for _ in range(t):
	(a, b, c) = map(lambda x: int(x), input().split())
	s = ''
	ch = 'a'
	d = b - c + 1
	temp = ''
	for _ in range(c):
		temp += ch
		ch = chr(ord(ch) + 1)
	l = ''
	for _ in range(math.floor(b / c)):
		l += temp
	l += temp[:b % c]
	for _ in range(math.floor(a / b)):
		s += l
	s += l[:a % b]
	print(s)


for _ in range(int(input())):
	(n, a, b) = map(int, input().split())
	l = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
	s = ''
	if b == 1:
		print('a' * n)
		continue
	if n == 2:
		print('ab')
		continue
	for i in range(b - 1):
		s = s + l[i]
	s += l[b - 1] * (a - b + 1)
	j = 0
	for i in range(n):
		print(s[j], end='')
		j = (j + 1) % a
	print()


def find_string(n, a, b):
	lista = list('abcdefghijklmnopqrstuvwxyz')
	string = ''
	substring = ''
	for i in range(b):
		substring += lista[i]
	substring += (a - b) * lista[i]
	string = n // a * substring
	for i in range(n % a):
		string += substring[i]
	return string
t = int(input())
for i in range(t):
	(n, a, b) = input().split()
	n = int(n)
	a = int(a)
	b = int(b)
	print(find_string(n, a, b))


for _ in range(int(input())):
	(n, a, b) = map(int, input().split())
	x = 'abcdefghijklmnopqrstuvwxyz'
	ans = x[:b]
	ans = n // b * ans + ans[:n % b]
	print(ans)


c = int(input())
for i in range(c):
	x = [int(k) for k in input().split(' ')]
	ss = ''
	sm = ''
	sl = ''
	for j in range(97, 97 + x[2]):
		ss = ss + chr(j)
	ss = ss * int(int(x[1] / x[2]) + 1)
	sm = ss[:x[1]]
	sm = sm * int(int(x[0] / x[1]) + 1)
	sl = sm[:x[0]]
	print(sl)


for _ in range(int(input())):
	(a, b, c) = map(int, input().split())
	u = ''
	chrt = 'a'
	for i in range(c):
		u = u + chrt
		chrt = chr(ord(chrt) + 1)
	z = a // c
	t = a % c
	mt = [u] * z
	for i in range(0, t):
		mt.append(u[i])
	print(''.join(mt))


def check(s, a, b):
	for i in range(0, len(s) - a + 1):
		if len(set(s[i:i + a])) != b:
			return False
	return True
import random
t = int(input())
for i in range(t):
	(n, a, b) = list(map(int, input().split()))
	ans = n * [0]
	dicti = {}
	alphabets = {'v', 'd', 'z', 'k', 'c', 't', 'g', 'j', 'n', 'm', 'f', 'e', 'b', 'o', 'x', 'i', 'y', 'u', 'w', 'p', 'l', 'h', 'q', 'r', 'a', 's'}
	distinct = 0
	index = -1
	for i in range(n):
		if index >= 0:
			dicti[ans[index]] -= 1
			if dicti[ans[index]] == 0:
				distinct -= 1
				del dicti[ans[index]]
		allowed = b - distinct
		if allowed == 0:
			chosen = random.choice(list(set(dicti.keys())))
		else:
			chosen = random.choice(list(alphabets - set(dicti.keys())))
		ans[i] = chosen
		try:
			dicti[chosen] += 1
		except:
			dicti[chosen] = 1
			distinct += 1
		if i >= a - 1:
			index += 1
	print(*ans, sep='')


n = int(input())
for i in range(n):
	(a, b, c) = [int(i) for i in input().split(' ')]
	result = ''
	for i in range(c):
		result += chr(97 + i)
	for i in range(b - c):
		result += result[0]
	for i in range(a - b):
		if i > b:
			result += result[i - b]
		else:
			result += result[i]
	print(result)


n = int(input())
s = 'abcdefghijklmnopqrstuvwxyz'
for i in range(n):
	(a, b, c) = [int(i) for i in input().split()]
	d = ''
	d = s[0:c]
	if c < b:
		d = d + d[0:b - c]
	if len(d) < a:
		e = a // len(d)
		if a % len(d) != 0:
			e = e + 1
		d = d * e
	print(d[0:a])


import math
t = int(input())
for _ in range(t):
	(n, a, b) = map(int, input().strip().split())
	arr = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
	raj = ''
	dup = ''
	for i in range(b):
		raj += arr[i]
		dup += arr[i]
	i = 0
	for j in range(a - b):
		raj += dup[i]
		i = (i + 1) % len(dup)
	i = 0
	third = raj
	for j in range(n - len(raj)):
		raj += third[i]
		i = (i + 1) % len(third)
	print(raj)


import collections, math, bisect
local = False
if local:
	file = open('input.txt', 'r')
	import time

def inp():
	if local:
		return file.readline().rstrip()
	else:
		return input().rstrip()

def ints():
	return [int(_) for _ in inp().split()]
if local:
	start = time.time()
t = int(inp())
for _ in range(1, t + 1):
	(n, a, b) = ints()
	i = 0
	ans = []
	while i < n:
		for j in range(b):
			nextChar = chr(ord('a') + j)
			ans.append(nextChar)
			i += 1
			if i >= n:
				break
		if i >= n:
			break
		for j in range(a - b):
			nextChar = chr(ord('a') + b - 1)
			ans.append(nextChar)
			i += 1
			if i >= n:
				break
	print(''.join(ans))
if local:
	fin = (time.time() - start) * 1000
	print('{:.2f}'.format(fin) + 'ms')


for case in range(int(input())):
	(n, a, b) = input().split()
	(n, a, b) = (int(n), int(a), int(b))
	res = ''
	for i in range(b):
		res += chr(97 + i)
	for i in range(a - b):
		k = int(i % b)
		res += res[k]
	for i in range(n - a):
		k = int(i % a)
		res += res[k]
	print(res)


ntest = int(input(''))
output = ''
for i in range(ntest):
	(n, a, b) = [int(i) for i in input('').split(' ')]
	lettre = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
	ilettre = 0
	for i in range(n):
		output += lettre[ilettre]
		if ilettre + 1 < b:
			ilettre += 1
		else:
			ilettre = 0
	print(output)
	output = ''


t = int(input())
_str = 'abcdefghijklmnopqrstuvwxyz'
for i in range(t):
	(n, a, b) = map(int, input().split())
	word = _str[:b]
	print(n // b * word + word[:n % b])


word = 'abcdefghijklmnopqrstuvwxyz'
for _ in range(int(input())):
	(n, a, b) = list(map(int, input().split()))
	ans = ''
	sub = word[:b]
	ans += sub
	for i in range(b, n):
		ans += word[i % b]
	print(ans)


for _ in range(int(input())):
	(n, a, b) = map(int, input().split())
	ans = []
	index = 0
	while index <= n:
		for i in range(b):
			ans.append(chr(97 + i))
		index += b
		if n - index < b:
			for i in range(n - index):
				ans.append(chr(97 + i))
			break
	print(''.join(ans))


from sys import stdin, exit, setrecursionlimit
setrecursionlimit(10000000)
input = stdin.readline
lmi = lambda : list(map(int, input().split()))
mi = lambda : map(int, input().split())
si = lambda : input().strip('\n')
ssi = lambda : input().strip('\n').split()
for _ in range(int(input())):
	(n, a, b) = mi()
	s = ''
	for i in range(n):
		s += chr(i % b + 97)
	print(s)


nr_cases = int(input())
for i in range(nr_cases):
	[n, a, b] = list(map(int, input().split()))
	s = ''
	while len(s) < n:
		for j in range(b):
			if len(s) >= n:
				break
			s = s + chr(j + 97)
	print(s)


n_cases = int(input())
for case_num in range(1, n_cases + 1):
	(n, a, b) = [int(x) for x in input().split()]
	print(''.join([chr(ord('a') + i % b) for i in range(n)]))


test = int(input())
i = 1
while i <= test:
	[n, a, b] = list(map(int, input().split()))
	char = []
	for j in range(b):
		char.append(chr(j + 97))
	ans = ''
	j = 0
	while j < n:
		k = 0
		while j < n and k < b:
			ans += char[k]
			k += 1
			j += 1
	i += 1
	print(ans)


s = 'abcdefghijklmnopqrstuvwxyz'
for t in range(int(input())):
	(n, a, b) = map(int, input().split())
	x = s[:b]
	m = n // len(x)
	ans = x * (m + 1)
	ans = ans[:n]
	print(ans)


t = int(input())
letters = 'abcdefghijklmnopqrstuvwxyz'
for i in range(t):
	(n, a, b) = map(int, input().split())
	output = ''
	uni = letters[:b]
	loop = int(n / b)
	rem = int(n % b)
	for j in range(loop):
		output += uni
	output += letters[:rem]
	print(output)


import sys
from string import ascii_lowercase as az
from math import ceil

def main():
	inp = sys.stdin.read().strip().split('\n')
	out = []
	for i in inp[1:]:
		(n, a, b) = map(int, i.split())
		out.append((az[:b] * int(ceil(n / b)))[:n])
	return out
print(*main(), sep='\n')


for _ in range(int(input())):
	(n, a, b) = map(int, input().split())
	c = 97
	l = []
	for i in range(n):
		if c == 97 + b:
			c = 97
		l.append(chr(c))
		c += 1
	print(*l, sep='')


t = int(input())
for q in range(t):
	(n, a, b) = map(int, input().split())
	st = ''
	for i in range(b):
		st += chr(ord('a') + i)
	ans = ''
	ans += st * (n // b)
	ans += st[0:n % b]
	print(ans)


s = 'abcdefghijklmnopqrstuvwxyz'

def AcDegaYeah():
	(n, a, b) = map(int, input().split())
	x = s[:b]
	x = x * n
	x = x[:n]
	print(x)
t = int(input())
for _ in range(t):
	AcDegaYeah()


import io
import os
from collections import Counter, defaultdict, deque

def solve(N, A, B):
	alpha = 'abcdefghijklmnopqrstuvwxyz'
	assert len(alpha) == 26
	letters = alpha[:B]
	ret = []
	for i in range(N):
		ret.append(letters[i % len(letters)])
	return ''.join(ret)
input = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline
T = int(input())
for t in range(T):
	(N, A, B) = [int(x) for x in input().split()]
	ans = solve(N, A, B)
	print(ans)


from collections import defaultdict
from itertools import cycle
import sys
input = sys.stdin.buffer.readline
t = int(input())
for _ in range(t):
	(n, a, b) = [int(el) for el in input().split()]
	s = 'abcdefghijklmnopqrstuvwxyz'
	s = s[:b]
	c = cycle(s)
	for i in range(n):
		print(c.__next__(), end='')
	print()


alp = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
ans = ''
fin_ans = []
for i in range(int(input())):
	ans = ''
	(n, a, b) = map(int, input().split())
	if a is b:
		while len(ans) < n:
			for i in range(26):
				ans += alp[i]
		fin_ans.append(ans[:n])
	else:
		ans_str = ''
		temp_str = str(''.join(alp[:b]))
		for j in range(n // b + 1):
			ans_str += temp_str
		ans += ans_str[:n]
		fin_ans.append(ans)
for i in fin_ans:
	print(i)


t = int(input())
while t > 0:
	nums = input().split()
	n = int(nums[0])
	a = int(nums[1])
	b = int(nums[2])
	res = ''
	i = 0
	while len(res) != b:
		res += chr(97 + i)
		i += 1
	res *= n // b
	for i in range(n % b):
		res += res[i]
	print(res)
	t -= 1


alpha = [chr(i) for i in range(97, 123)]
test = int(input())
for t in range(test):
	(n, a, b) = list(map(int, input().split()))
	bstamp = ''
	for a in range(b):
		bstamp += alpha[a]
	muls = n // b
	rem = n % b
	x = bstamp * muls + bstamp[:rem]
	print(x)


from sys import stdin

def solve(n, a, b):
	m = [chr(ord('a') + i) for i in range(26)]
	for i in range(n):
		print(m[i % b], end='')
	print()

def main():
	inp = stdin.readline
	for _ in range(int(inp())):
		(n, a, b) = list(map(int, inp().split()))
		solve(n, a, b)
main()


for _ in range(int(input())):
	(n, a, b) = map(int, input().split())
	ll = []
	for i in range(b):
		ch = chr(ord('a') + i)
		ll.append(ch)
	pos = 0
	while len(ll) < a:
		ll.append(ll[pos])
		pos = (pos + 1) % b
	while len(ll) < n:
		ll.append(ll[pos])
		pos = (pos + 1) % a
	print(''.join(ll))


t = int(input())
n = []
a = []
b = []
for i in range(t):
	whole_input = input()
	(n1, a1, b1) = whole_input.split()
	n.append(int(n1))
	a.append(int(a1))
	b.append(int(b1))
for j in range(t):
	s = ''
	lenght = 0
	start = 97
	i = -1
	while lenght < n[j]:
		if i == b[j] - 1:
			i = 0
		else:
			i += 1
		lenght += 1
		s += chr(start + i)
	print(s)


for _ in range(int(input())):
	(n, a, b) = map(int, input().split())
	init = 97
	str1 = ''
	for i in range(b):
		str1 += chr(init)
		init += 1
	str1 += chr(init - 1) * (a - b)
	for i in range(n - a):
		str1 += str1[i]
	print(str1)


t = int(input())
cases = []
for i in range(t):
	line = input().split()
	cases.append([int(item) for item in line])
for case in cases:
	n = case[0]
	a = case[1]
	b = case[2]
	string = []
	c = 0
	for i in range(n):
		if c >= b:
			c = 0
		string.append(chr(c + 97))
		c += 1
	print(''.join(string))


t = int(input())
for i in range(t):
	(n, a, b) = input().split()
	n = int(n)
	a = int(a)
	b = int(b)
	s = ''
	q = 97
	w = 97
	for j in range(b):
		ch = chr(q)
		s += ch
		q += 1
	div = n // b
	mod = n % b
	s *= div
	if mod != 0:
		for j in range(mod):
			che = chr(w)
			s += che
			w += 1
		print(s)
	else:
		print(s)


cases = int(input())
letters = 'abcdefghijklmnopqrstuvwxyz'
ans = []
while cases:
	cases -= 1
	(n, a, b) = [int(x) for x in input().split(' ')]
	st = letters[0:b]
	while len(st) < a:
		st += st[-1]
	index = 0
	while len(st) < n:
		st += st[index]
		index += 1
	ans.append(st)
for a in ans:
	print(a)


for _ in range(int(input())):
	(n, a, b) = map(int, input().split())
	alpha = 'abcdefghijklmnopqrstuvwxyz'
	alpha1 = alpha[:b] * n
	print(alpha1[:n])


q = int(input())
o = 97
for _ in range(q):
	(n, a, b) = map(int, input().split())
	s = 'a' * (a + 1 - b)
	c = 1
	for i in range(1, 26):
		if b - c > 0:
			s += chr(o + c)
			c += 1
	r = n // len(s)
	ans = s * r + s[0:n % len(s)]
	print(ans)


c = int(input())
for t in range(c):
	str = ''
	(n, a, b) = input().split(' ')
	(n, a, b) = (int(n), int(a), int(b))
	for z in range(n - a + 1):
		if z == 0:
			for x in range(97, 97 + b):
				str += chr(x)
			str = str + chr(97) * (a - b)
		else:
			str = str + str[z - 1]
	print(str)


ss = 'abcdefghijklmnopqrstuvwxyz'

def solve(n, a, b):
	s = ss[0:b]
	s = s * (a // b) + s[0:a % b]
	print(s * (n // a) + s[0:n % a])
for _ in range(int(input())):
	(n, a, b) = map(int, input().split())
	solve(n, a, b)


MAIN = 'abcdefghijklmnopqrstuvwxyz'
T = int(input())
Anstemp = ''
for _ in range(T):
	(N, A, B) = map(int, input().split())
	if B > 26:
		B = 26
	Anstemp = MAIN[0:B]
	Ans = (Anstemp * (N // B + 2))[:N]
	print(Ans)


import sys
input = sys.stdin.buffer.readline
from collections import Counter

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

def sieve(n):
	a = [1] * n
	for i in range(2, n):
		if a[i]:
			for j in range(i * i, n, i):
				a[j] = 0
	return a
for __ in range(int(input())):
	(n, a, b) = I()
	s = 'a' * (a - b + 1)
	for i in range(b - 1):
		s += chr(98 + i)
	ans = ''
	ans = n // len(s) * s + s[:n % len(s)]
	print(ans)


import math
import random
import sys
from collections import Counter, defaultdict, deque, namedtuple, UserDict
from functools import cmp_to_key, lru_cache, reduce
sys.setrecursionlimit(10 ** 5 + 1)
write = sys.stdout.write
input = sys.stdin.buffer.readline
MOD = 10 ** 9 + 7
test_case_num = int(input())
for _ in range(test_case_num):
	(n, a, b) = map(int, input().split())
	ans = []
	unit = []
	for i in range(a):
		unit.append(chr(ord('a') + i % b))
	ans = unit * (n // a) + unit[:n % a]
	print(''.join(ans))


t = int(input())
for i in range(t):
	(n, a, b) = map(int, input().split())
	s = ''
	j = 0
	k = 0
	while j < n:
		s += chr(ord('a') + j % b)
		j += 1
	print(s)


t = int(input())
for i in range(t):
	isplit = input().split()
	n = int(isplit[0])
	a = int(isplit[1])
	b = int(isplit[2])
	chars = 'abcdefghijklmnopqrstuvwxyz'
	seq = chars[:b]
	s = ''.join((seq[j % len(seq)] for j in range(n)))
	print(s)


T = int(input())
for _ in range(0, T):
	(n, a, b) = map(int, input().split())
	st = 'a' * (a - b + 1)
	for i in range(1, b):
		st += chr(i + 97)
	q = n // a
	r = n % a
	st = st * q + st[:r]
	print(st)


for _ in range(int(input())):
	(a, b, c) = map(int, input().split())
	x = ''
	y = 'abcdefghijklmnopqrstuvwxyz'
	while len(x) < a:
		x += y[0:c]
		x += 'a' * (b - c)
	print(x[0:a])


t = int(input())
for x in range(t):
	new_str = ''
	(long_of_str, long_of_podstr, podstr_set) = map(int, input().split())
	for y in range(long_of_str):
		new_str += chr(y % podstr_set + 97)
	print(new_str)


from collections import Counter
import string
import math
import sys
from fractions import Fraction

def array_int():
	return [int(i) for i in sys.stdin.readline().split()]

def vary(arrber_of_variables):
	if arrber_of_variables == 1:
		return int(sys.stdin.readline())
	if arrber_of_variables >= 2:
		return map(int, sys.stdin.readline().split())

def makedict(var):
	return dict(Counter(var))

def printDivisors(n):
	divisors = []
	i = 1
	while i <= math.sqrt(n):
		if n % i == 0:
			if n // i == i:
				divisors.append(i)
			else:
				divisors.extend((i, n // i))
		i = i + 1
	return divisors

def countTotalBits(num):
	binary = bin(num)[2:]
	return len(binary)

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
for _ in range(vary(1)):
	(n, a, b) = vary(3)
	ans = ''
	for i in range(b):
		ans += chr(97 + i)
	sol = ''
	i = 0
	j = 0
	while i < n:
		if j >= b:
			j = 0
		sol += ans[j]
		i += 1
		j += 1
	print(sol)


for i in range(int(input())):
	(a, b, c) = list(map(int, input().split(' ')))
	rl = []
	d = []
	for alpha in range(97, 97 + c):
		rl.append(chr(alpha))
	for i in range(a):
		for j in range(c):
			d.append(rl[j])
			if len(d) == a:
				break
		print(d[i], end='')
	print('')


num = int(input())
letras = []
for i in range(26):
	letras.append(chr(97 + i))
for j in range(num):
	s = ''
	(n, a, b) = (int(x) for x in input().split(' '))
	stri = letras[:b]
	s += (a - b) * 'a'
	cont = 0
	while len(s) != n:
		s += stri[cont % len(stri)]
		cont += 1
	print(s)


l = 'abcdefghijklmnopqrstuvwxyz'
for _ in range(int(input())):
	(n, a, b) = map(int, input().split())
	x = ''
	for i in l[0:b]:
		x = x + i
	x = x * n
	for i in range(n):
		print(x[i], end='')
	print()


let = list('abcdefghijklmnopqrstuvwxyz')
for i in range(int(input())):
	(n, a, b) = map(int, input().split())
	ans = ''
	for j in range(b):
		ans += let[j]
	for j in range(b, a):
		ans += let[0]
	j = a
	while j < n:
		xxx = set(ans[j - b + 1:j])
		for k in let:
			if k not in xxx:
				ans += k
				break
		j += 1
	print(ans)


import math

def fun1():
	test = int(input())
	l = 0
	while test:
		(n, a, b) = map(int, input().split(' '))
		ch = 'abcdefghijklmnopqrstuvwxyz'
		k = math.ceil(n / b)
		c = str(ch[:b]) * k
		c = c[:n]
		print(c)
		test -= 1
fun1()


from __future__ import division, print_function
import os, sys
from io import BytesIO, IOBase
if sys.version_info[0] < 3:
	from __builtin__ import xrange as range
	from future_builtins import ascii, filter, hex, map, oct, zip

def ii():
	return int(input())

def si():
	return input()

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

def li():
	return list(mi())

def read():
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')

def gcd(x, y):
	while y:
		(x, y) = (y, x % y)
	return x
mod = 1000000007
import math
import bisect
abc = 'abcdefghijklmnopqrstuvwxyz'

def main():
	for _ in range(ii()):
		(n, a, b) = mi()
		s = ''
		s += abc[0:b - 1]
		x = a - b + 1
		s += x * abc[b - 1]
		y = int(math.ceil(n / a))
		s *= y
		print(s[0:n])
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')

def print(*args, **kwargs):
	(sep, file) = (kwargs.pop('sep', ' '), kwargs.pop('file', sys.stdout))
	at_start = True
	for x in args:
		if not at_start:
			file.write(sep)
		file.write(str(x))
		at_start = False
	file.write(kwargs.pop('end', '\n'))
	if kwargs.pop('flush', False):
		file.flush()
if sys.version_info[0] < 3:
	(sys.stdin, sys.stdout) = (FastIO(sys.stdin), FastIO(sys.stdout))
else:
	(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


for _ in range(int(input())):
	(n, a, b) = map(int, input().split())
	x = n - a
	aski = 97
	s = ''
	while a > 0:
		s += chr(aski)
		aski += 1
		if aski == b + 97:
			aski = 97
		a -= 1
	s += s * (n + a)
	print(s[0:n])


t = int(input())
import string
for _ in range(t):
	(n, a, b) = map(int, input().split())
	if a == 1 or b == 1:
		print('a' * n)
	else:
		temp = string.ascii_lowercase[:b]
		(d, r) = divmod(n, b)
		print(temp * d + temp[:r])


for _ in range(int(input())):
	(n, a, b) = list(map(int, input().split()))
	s_b = ''
	for i in range(b):
		s_b += chr(97 + i)
	(t, s) = divmod(a, b)
	s_a = s_b * t + s_b[:s]
	(t, s) = divmod(n, a)
	res = s_a * t + s_a[:s]
	print(res)


t = int(input())
while t:
	t -= 1
	(a, b, c) = list(map(int, input().strip().split()))[0:3]
	i = 0
	x = 0
	while i < a:
		print(chr(ord('a') + x), end='')
		x += 1
		x %= c
		i += 1
	print('')


t = int(input())
for i in range(t):
	(n, a, b) = [int(s) for s in input().split()]
	alphabet = 'abcdefghijklmnopqrstuvwxyz'
	dict_ = alphabet[:b]
	ans = dict_
	for i in range(n - b):
		ans += dict_[i % b]
	print(ans)


T = int(input())
results = []
from string import ascii_lowercase
for _ in range(T):
	(n, a, b) = map(int, input().split(' '))
	chosen = ascii_lowercase[:b]
	while len(chosen) < n:
		chosen += chosen
		if len(chosen) > n:
			chosen = chosen[:n]
	results.append(chosen)
for r in results:
	print(r)


t = int(input())
for _ in range(t):
	(n, a, b) = input().split()
	n = int(n)
	a = int(a)
	b = int(b)
	s = 'abcdefghijklmnopqrstuvwxyz'
	y = s[0:b]
	ans = ''
	for i in range(int(n / b)):
		ans = ans + y
	ans += y[0:n % b]
	print(ans)


import math

def solve(l1):
	(n, a, b) = map(int, input().split())
	v = a - b
	v = v + 1
	s = ''
	for i in range(b - 1):
		s += str(l1[i])
	s += str(l1[b - 1]) * v
	if len(s) == n:
		print(s)
	else:
		j = len(s)
		p = n - j
		for i in range(p):
			s += s[i % j]
		print(s)
l1 = []
for i in range(ord('a'), ord('z') + 1):
	l1.append(chr(i))
for _ in range(int(input())):
	solve(l1)


q = int(input())
while q != 0:
	q -= 1
	(n, a, b) = map(int, input().split())
	alph = 'abcdefghijklmnopqrstuvwxyz'
	s = ''
	for i in range(n):
		s += alph[:b]
	s = s[:n]
	print(s)


for x in range(int(input())):
	(n, a, b) = map(int, input().split())
	s = ''
	c = 0
	for x in range(b):
		c += 1
		s += chr(97 + x)
	for x in range(a - b):
		s += s[-1]
	while len(s) < n:
		s += s[-a]
	print(s)


t = int(input())
alpha = 'abcdefghijklmnopqrstuvwxyz'
while t > 0:
	s = ''
	(N, A, B) = input().split()
	n = int(N)
	b = int(B)
	pos = 0
	for i in range(n):
		if pos < b:
			s = s + alpha[pos]
			pos += 1
		if pos >= b:
			pos = 0
	print(s)
	t -= 1


t = int(input())
for u in range(t):
	(n, s, d) = list(map(int, input().split()))
	w = ''
	j = 0
	for i in range(n):
		w = w + chr(ord('a') + j)
		j += 1
		if j % d == 0:
			j = 0
	print(w)


t = int(input())
for i in range(t):
	(n, a, b) = map(int, input().split())
	s = ''
	for i in range(b):
		s += chr(97 + i)
	c = n // b
	s = s * c
	d = n - c * b
	for i in range(d):
		s += chr(97 + i)
	print(s)


t = int(input())
for _ in range(t):
	(n, a, b) = map(int, input().split())
	ans = ''
	alpha = 'abcdefghijklmnopqrstuvwxyz'
	for i in range(n):
		for j in range(b):
			ans += alpha[j]
		for i in range(a - b):
			ans += ans[-1]
		if len(ans) > n:
			break
	print(ans[:n])


from sys import stdin, stdout
from collections import deque
rl = lambda : stdin.readline()
rll = lambda : stdin.readline().split()

def main():
	T = int(rl())
	to_char = lambda n: chr(n + 97)
	for _ in range(T):
		(n, a, b) = (int(x) for x in rll())
		ans = []
		for i in range(n):
			ans.append(to_char(i % b))
		stdout.write(''.join((x for x in ans)))
		stdout.write('\n')
	stdout.close()
main()


t = int(input())
import math
for i in range(t):
	l = str.split(input(), ' ')
	n = int(l[0])
	a = int(l[1])
	b = int(l[2])
	ans = ''
	for i in range(n):
		i = i % b
		ans = ans + chr(97 + i)
	print(ans)


for loop in range(int(input())):
	data = input()
	[s, a, b] = list(map(int, data.split()))
	letters = 'abcdefghijklmnopqrstuvwxyz'
	reponse = letters[:b]
	finale = reponse * s
	final = finale[:s]
	print(final)


t = int(input())
for i in range(t):
	inp = list(map(int, input().split()))
	n = inp[0]
	a = inp[1]
	b = inp[2]
	string = ''
	if inp[1] > 1 and inp[2] > 1:
		temp = ''
		for j in range(b):
			string += chr(97 + j)
		temp = string
		for j in range(int(inp[0] / inp[2]) - 1):
			string += temp
		for j in range(inp[0] % inp[2]):
			string += temp[j]
	elif inp[2] == 1 and inp[1] > 1:
		for j in range(inp[0]):
			string += 'a'
	elif inp[2] == 1 and inp[1] == 1:
		if n < 27:
			for j in range(inp[0]):
				string += chr(97 + j)
		else:
			temp = ''
			for j in range(26):
				string += chr(97 + j)
			temp = string
			for j in range(int(inp[0] / 26) - 1):
				string += temp
			for j in range(inp[0] % 26):
				string += temp[j]
	print(string)


import sys
_INPUT_LINES = sys.stdin.read().splitlines()
input = iter(_INPUT_LINES).__next__

def go():
	alp = 'abcdefghijklmnopqrstuvwxyz'
	(n, a, b) = map(int, input().split())
	r = [alp[:b]] * (10 + n // b)
	return ''.join(r)[:n]
t = int(input())
ans = []
for _ in range(t):
	ans.append(str(go()))
print('\n'.join(ans))


from sys import stdin
a = int(stdin.readline())
l = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
for k in range(0, a):
	b = stdin.readline().split()
	A = int(b[0])
	B = int(b[1])
	C = int(b[2])
	s = ''
	while True:
		d = 0
		while d < B - C + 1 and len(s) < A:
			m = 0
			s = s + l[m % 26]
			d += 1
		m += 1
		if len(s) == A:
			print(s)
			break
		r = 0
		while len(s) < A and r < C - 1:
			s = s + l[m % 26]
			r += 1
			m += 1
		if len(s) == A:
			print(s)
			break


def solveTC():
	(n, a, b) = [int(x) for x in input().split(' ')]
	s = ''
	basestr = [chr(ord('a') + i) for i in range(b)]
	for ch in basestr:
		s += ch
	ans = ''
	for i in range(int(n / b)):
		ans += s
	for i in range(n % b):
		ans += s[i]
	return ans
t = input()
for tc in range(int(t)):
	ans = solveTC()
	print(ans)


import random, math
from copy import deepcopy as dc

def solution(n, a, b):
	s = ''
	for i in range(97, 97 + b):
		s += str(chr(i))
	tot = math.ceil(n / b)
	s = s * tot
	return s[:n]

def input_test():
	for _ in range(int(input())):
		(n, a, b) = map(int, input().strip().split(' '))
		print(solution(n, a, b))
input_test()


for _ in range(int(input())):
	(n, a, b) = (int(x) for x in input().split())
	ans = ['' for _ in range(n)]
	alph = [chr(97 + i) for i in range(26)][:b]
	for i in range(n):
		ans[i] = alph[i % b]
	print(''.join(ans))


import string

def fun(test_case):
	(n, a, b) = test_case
	req_chars = chars[:b]
	s = ''
	for c in range(n):
		s += req_chars[c % b]
	return s
n_test_cases = int(input())
test_cases = []
chars = string.ascii_lowercase
for i in range(n_test_cases):
	test_cases.append(list(map(int, input().split(' '))))
for test_case in test_cases:
	print(fun(test_case))


import sys
t = int(input())
for i in range(t):
	(n, a, b) = map(int, input().split())
	strg = []
	for i in range(n):
		if i % b == 0:
			char = 'a'
		else:
			char = chr(ord(char) + 1)
		strg.append(char)
	for i in strg:
		sys.stdout.write(i)
	print()


t = int(input())
al = 'abcdefghijklmnopqrstuvwxyz'
c = []
for i in range(t):
	A = input().split(' ')
	n = int(A[0])
	a = int(A[1])
	b = int(A[2])
	rez = ''
	j = 0
	for i in range(n):
		rez += al[j]
		j += 1
		if j == b:
			j = 0
	c.append(rez)
for i in range(t):
	print(c[i])


from sys import stdin
rInt = lambda : int(stdin.readline().strip('\n'))
rIntArray = lambda : [int(x) for x in stdin.readline().split()]
rString = lambda : stdin.readline().strip('\n')
rStrArray = lambda : [x for x in stdin.readline().split()]
for _ in range(rInt()):
	(n, a, b) = rIntArray()
	s = [''] * n
	for i in range(n):
		s[i] = chr(ord('a') + i % b)
	print(''.join(s))


s = 'qwertyuiopasdfghjklmnbvcxz'
t = int(input())
for i in range(t):
	(n, a, b) = [int(u) for u in input().split()]
	ss = s[0:b]
	k = (n + n - 1) // b
	fs = ss * k
	fs = fs[:n]
	print(fs)


counter = int(input())
for z in range(counter):
	(n, a, b) = [int(x) for x in input().split()]
	distinct = 0
	word = ''
	index = 0
	while len(word) != n:
		sub = word[index:]
		distinct = len(set(sub))
		lett = ord('a')
		while distinct < b:
			while chr(lett) in sub:
				lett += 1
			word = word + chr(lett)
			sub = sub + chr(lett)
			distinct += 1
		keys = list(set(sub))
		size = len(keys)
		temp = 0
		while len(sub) < a:
			sub = sub + keys[temp]
			word = word + keys[temp]
			temp = (temp + 1) % size
		index += 1
	print(word)


def wa(a, b, c):
	s = ''
	w2 = ''
	w3 = ''
	w4 = ''
	f = 0
	for i in range(ord('a'), ord('z') + 1):
		s += chr(i)
		f += 1
		if f == c:
			break
	for i in range(0, a, 1):
		w2 += s
	w3 = w2[0:a]
	return w3

def check(x, y, z):
	g = ''
	fuck = 0
	for i in range(0, x, 1):
		g += 'a'
	return g
test = int(input())
for i in range(1, test + 1, 1):
	(x, y, z) = map(int, input().split())
	if z == 1 and y == 1:
		print(check(x, y, z))
	else:
		print(wa(x, y, z))


import os, sys, bisect, copy
from collections import defaultdict, Counter, deque
from functools import lru_cache
if os.path.exists('in.txt'):
	sys.stdin = open('in.txt', 'r')
if os.path.exists('out.txt'):
	sys.stdout = open('out.txt', 'w')

def input():
	return sys.stdin.readline()

def mapi(arg=0):
	return map(int if arg == 0 else str, input().split())
for _ in range(int(input())):
	(n, a, b) = mapi()
	letters = [chr(i + ord('a')) for i in range(min(b, 26))]
	res = []
	i = 0
	while i < n:
		for j in range(a - b + 1):
			res.append('a')
		i += 1
		for j in range(1, b):
			res.append(letters[j])
	print(''.join(res[:n]))


import sys
t = int(sys.stdin.readline())
for _ in range(t):
	(n, a, b) = map(int, sys.stdin.readline().split())
	total = 0
	out = ''
	i = 0
	while total != n:
		out += chr(ord('a') + i % b)
		i += 1
		total += 1
	print(out)


cases = int(input())
alphabet = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']

def find_res(a, b, n):
	if a == b == 1:
		res = ''
		al_i = 0
		for _ in range(n):
			res += alphabet[al_i]
			al_i += 1
			if al_i == len(alphabet):
				al_i = 0
		return res
	if b == 1 and a == n:
		return alphabet[0] * n
	else:
		res = ''
		al_i = 0
		for _ in range(n):
			res += alphabet[al_i]
			al_i += 1
			if al_i == b:
				al_i = 0
		return res
for _ in range(cases):
	(n, a, b) = list(map(int, input().split()))
	print(find_res(a, b, n))


t = int(input())
for _ in range(t):
	(n, a, b) = map(int, input().split())
	s = 'qwertyuiopasdfghjklzxcvbnm'
	res = ''
	for i in range(b):
		res += s[i]
	for i in range(a - b):
		res += res[-1]
	for i in range(n - a):
		res += res[len(res) - a]
	print(res)


for _ in range(int(input())):
	(n, a, b) = map(int, input().split())
	ch = 'a'
	A = [chr(ord(ch) + x) for x in range(b)]
	for i in range(n):
		print(A[i % b], end='')
	print()


def func(n, a, b):
	s = ''
	for i in range(b):
		s = s + chr(97 + i)
	s = s + chr(97 + b - 1) * (a - b)
	for i in range(n - a):
		s = s + s[i]
	return s
t = int(input())
for _ in range(t):
	s = list(map(int, input().split()))
	(n, a, b) = (s[0], s[1], s[2])
	print(func(n, a, b))


T = int(input())
S = [chr(97 + i) for i in range(26)]
for _ in range(T):
	(n, a, b) = map(int, input().split())
	res = S[:b] * (n // b + 1)
	res = res[:n]
	print(''.join(res))


t = int(input())
for i in range(t):
	s = 'abcdefghijklmnopqrstuvwxyz'
	(n, a, b) = list(map(int, input().split()))
	temp = ''
	for j in range(b):
		temp += s[j]
	st = temp
	k = 0
	f = True
	for j in range(b, n):
		st += temp[k]
		k += 1
		if k == b:
			k = 0
	print(st)


for _ in range(int(input())):
	(n, a, b) = map(int, input().split())
	start = 97
	end = 97 + b - 1
	point = start
	for _ in range(n):
		print(chr(point), end='')
		point += 1
		if point > end:
			point = start
	print()


from sys import stdin, stdout
from math import sqrt, ceil, gcd, log, log10
t = int(input())
for _ in range(t):
	(n, a, b) = map(int, stdin.readline().split())
	offset = ord('a')
	l = []
	for i in range(b):
		l.append(chr(i + offset))
	ans = []
	while len(ans) < n:
		ans.extend(l)
	print(''.join(ans[:n]))


def foo(n, a, b):
	l = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
	result = ['a'] * n
	for i in range(b):
		j = i
		while j < n:
			result[j] = l[i]
			j += b
	print(''.join(result))
test = int(input())
for each in range(test):
	(n, a, b) = (int(x) for x in input().split())
	foo(n, a, b)


import string
for i in range(int(input())):
	li = []
	(sl, n, d) = [int(x) for x in input().split()]
	for i in string.ascii_lowercase:
		li.append(i)
		if len(li) < d:
			continue
		else:
			break
	for i in range(sl):
		print(li[i % d], end='')
	print('')


import sys
input = sys.stdin.readline
t = int(input())
base = 'abcdefghijklmnopqrstuvwxyz'
for _ in range(t):
	(n, a, b) = map(int, input().split())
	ret = base[:b] * (n // b)
	ret += base[:n % b]
	print(ret)


for _ in range(int(input())):
	(n, a, b) = map(int, input().split())
	q = 'a' * (a - b + 1)
	x = q + ''.join([chr(i + ord('b')) for i in range(b - 1)])
	s = x * (n // a)
	s += x[:n % a]
	print(s)


import math
import string
t = int(input())
for _ in range(t):
	(n, a, b) = list(map(int, input().split()))
	s = ''
	i = 0
	while len(s) < n:
		s += string.ascii_letters[:b]
		i += 1
	print(s[:n])


for _ in range(int(input())):
	(n, a, b) = map(int, input().split())
	s = ''
	s1 = ''
	i = 0
	for i in range(b - 1):
		s1 += chr(97 + i)
	s1 += chr(97 + i + 1) * (a - b + 1)
	s = s1 * 2000
	print(s[:n])


l = list('abcdefghijklmnopqrstuvwxyz')
for _ in range(int(input())):
	(n, a, b) = map(int, input().split())
	ans = ''
	p = 0
	(c, d) = (a, b)
	for i in range(a):
		if d == 0:
			break
		ans += l[p]
		p += 1
		d -= 1
	ans = ans * (n // b + 1)
	print(ans[:n])


def stringcreator(a, b, c):
	l = ''
	for j in range(a):
		l += chr(ord('a') + j % c)
	return l
t = int(input())
for i in range(t):
	(a, b, c) = map(int, input().split())
	print(stringcreator(a, b, c))


for _ in range(int(input())):
	(n, a, b) = map(int, input().split())
	r = 'a' * (a - b + 1)
	for i in range(1, b):
		r += chr(ord('a') + i)
	c = 0
	for i in range(n):
		t = i
		if i - c * a < a:
			print(r[i - c * a], end='')
			if i - c * a == a - 1:
				c += 1
	print()


def builder(n, b):
	s = ''
	for i in range(n):
		s += chr(i % b + 97)
	return s
for _ in range(int(input())):
	(m, x, y) = [int(i) for i in input().split()]
	print(builder(m, y))


def main():
	op = ''
	t = int(input())
	for i in range(t):
		(n, a, b) = map(int, input().split(' '))
		s = ''
		x = 0
		for i in range(a):
			if i < b:
				s += chr(97 + i)
			else:
				s += s[x]
				x = circle(x, b)
		x = 0
		for i in range(a, n):
			s += s[x]
			x = circle(x, b)
		op += s + '\n'
	print(op)

def circle(x, b):
	if x == b - 1:
		return 0
	return x + 1
main()


import sys
Ri = lambda : [int(x) for x in sys.stdin.readline().split()]
ri = lambda : sys.stdin.readline().strip()

def input():
	return sys.stdin.readline().strip()

def list2d(a, b, c):
	return [[c] * b for i in range(a)]

def list3d(a, b, c, d):
	return [[[d] * c for j in range(b)] for i in range(a)]

def list4d(a, b, c, d, e):
	return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]

def ceil(x, y=1):
	return int(-(-x // y))

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

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

def LIST(N=None):
	return list(MAP()) if N is None else [INT() for i in range(N)]

def Yes():
	print('Yes')

def No():
	print('No')

def YES():
	print('YES')

def NO():
	print('NO')
INF = 10 ** 18
MOD = 10 ** 7
for _ in range(int(ri())):
	(n, a, b) = Ri()
	ans = []
	for i in range(b):
		ans.append(chr(ord('a') + i))
	div = n // b
	rem = n % b
	temp = []
	for i in range(div):
		temp += ans
	for i in range(rem):
		temp.append(ans[i])
	print(''.join(temp))


t = int(input())
r = []
alf = 'abcdefghijklmnopqrstuvwxyz'
for ooo in range(t):
	(n, x, y) = [int(aaa) for aaa in input().split()]
	k = alf[:y]
	s = k
	s += k * ((n - y) // y)
	s += k[:(n - y) % y]
	r.append(s)
for i in r:
	print(i)


t = int(input())
while t:
	t -= 1
	(n, a, b) = map(int, input().split())
	d = 97
	l = 1
	while n:
		n -= 1
		print(chr(d), end='')
		d += 1
		l += 1
		if l > b:
			d = 97
			l = 1
	print()


import string
T = int(input())
results = []
for case in range(T):
	(n, a, b) = [int(i) for i in input().split()]
	alphabet = string.ascii_lowercase
	s = ''
	begin_extra = a - b
	if begin_extra < 0:
		begin_extra = 0
	repeat = begin_extra * alphabet[0] + alphabet[:b]
	for i in range(n):
		s += repeat[i % a]
	results.append(s)
for result in results:
	print(result)


from string import ascii_lowercase
from math import ceil
for _ in range(int(input())):
	(n, a, b) = map(int, input().split())
	letters = ascii_lowercase[:b]
	print((letters * ceil(n / b))[:n])


alf = 'bcdefghijklmnopqrstuvwxyz'
for i in range(int(input())):
	(n, a, b) = map(int, input().split())
	s = ''
	for i in range(n // a + 1):
		s += 'a' * (a - b + 1) + alf[:b - 1]
	print(s[:n])


def f(n, a, b):
	alphabet = {'0': 'a', '1': 'b', '2': 'c', '3': 'd', '4': 'e', '5': 'f', '6': 'g', '7': 'h', '8': 'i', '9': 'j', '10': 'k', '11': 'l', '12': 'm', '13': 'n', '14': 'o', '15': 'p', '16': 'q', '17': 'r', '18': 's', '19': 't', '20': 'u', '21': 'v', '22': 'w', '23': 'x', '24': 'y', '25': 'z'}
	numbers = []
	for i in range(b):
		numbers.append(alphabet.get(f'{i}', 'f'))
	numbers1 = numbers.copy()
	for i1 in range(a - b):
		numbers1.append(numbers[-1])
	for i2 in range(n - a):
		numbers1.append(numbers1[i2])
	print(''.join(numbers1))
t = int(input())
for i in range(t):
	(n, a, b) = map(int, input().split())
	f(n, a, b)


from sys import stdin

def solve(n, a, b):
	abc = 'abcdefghijklmnopqrstuvwxyz'
	ans = abc[:b] * (n // b)
	ans += abc[:n % b]
	return ans

def main():
	r = stdin.readline
	cases = int(r())
	for case in range(cases):
		(n, a, b) = map(int, r().strip().split())
		print(solve(n, a, b))
main()


t = int(input())
for i in range(t):
	(n, a, b) = [int(z) for z in input().split()]
	word = 'a' * (a - b) + 'abcdefghijklmnopqrstuvwxyz'[:b]
	print(f'{word * (n // a) + word[:n % a]}')


import sys
IN = sys.stdin.readline
for i in range(int(IN())):
	(n, a, b) = map(int, IN().split())
	j = 0
	s = ''
	for k in range(n):
		s += chr(ord('a') + j)
		j = j + 1
		if j == b:
			j = 0
	print(s)


t = int(input())
while t > 0:
	(n, a, b) = map(int, input().split())
	res = list(map(chr, range(97, 123)))
	str = ''
	j = 0
	for i in range(n):
		str = str + res[j]
		j = j + 1
		if j == b:
			j = 0
	print(str)
	t = t - 1


import sys

def solve(n, a, b):
	ans = ''
	for i in range(n):
		ans += chr(ord('a') + i % b)
	return ans
t = int(next(sys.stdin))
for _ in range(t):
	ln = next(sys.stdin)
	(n, a, b) = map(int, ln.split())
	print(solve(n, a, b))


alf = 'qwertyuiopasdfghjklzxcvbnm'
for i in range(int(input())):
	(n, a, b) = map(int, input().split())
	ans = alf[0:b]
	ans *= 4000000
	print(ans[:n])


t = int(input())
for i in range(t):
	(n, a, b) = map(int, input().split())
	l = []
	for i in range(b):
		l.append(chr(97 + i))
	if len(l) == n:
		pass
	else:
		while n - b > 0:
			l = l + l
			if len(l) > n:
				break
	print(''.join(l[0:n]))


t = int(input())
for _ in range(t):
	(n, a, b) = list(map(int, input().split()))
	first_char = 97
	char_list = [chr(first_char + i) for i in range(26)] if a == b else [chr(first_char + i) for i in range(b)]
	string = ''
	for i in range(n):
		string += char_list[i % len(char_list)]
	print(string)


for i in range(int(input())):
	nab = list(map(int, input().split()))
	alpha = 'abcdefghijklmnopqrstuvwxyz'
	s = ''
	res = ''
	n = nab[0]
	a = nab[1]
	b = nab[2]
	for i in range(a // b + 1):
		s += alpha[:b]
	s = s[:a]
	for i in range(n // a + 1):
		res += s
	print(res[:n])


alpha = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
for _ in range(int(input())):
	(n, a, b) = map(int, input().split())
	res = ''
	if b == 1 or a == 1:
		res += 'a' * n
	elif a == b:
		j = 0
		for i in range(n):
			res += alpha[j]
			j += 1
			if j >= 26:
				j = 0
	else:
		count = 0
		ind = 0
		i = 0
		while i < n:
			if count < b:
				res += alpha[ind]
				ind += 1
				count += 1
				i += 1
				if count == b:
					ind = 0
			else:
				res += res[ind]
				i += 1
				ind += 1
	print(res)


t = int(input())
arr = 'abcdefghijklmnopqrstuvwxyz'
for _ in range(t):
	(n, a, b) = map(int, input().split(' '))
	ans = ''
	for i in range(b):
		ans = ans + arr[i]
	n = n - b
	x = n // b
	ans = ans + ans * x
	x = n % b
	for i in range(x):
		ans = ans + ans[i]
	print(ans)


t = int(input())
for _ in range(t):
	s = 'abcdefghijklmnopqrstuvwxyz'
	(n, a, b) = list(map(int, input().split()))
	c = s[0:b]
	result = c + c[-1] * (a - b)
	result = result * (n // a) + result[0:n - n // a * a]
	print(result)


t = int(input())
for i in range(0, t, 1):
	z = list(map(int, input().split(' ')))
	n = z[0]
	a = z[1]
	b = z[2]
	s = [None] * n
	for j in range(0, b, 1):
		s[j] = chr(97 + j)
	l = 0
	for k in range(b, n, 1):
		s[k] = s[l]
		l += 1
		if l == b:
			l = 0
	y = ''.join(map(str, s))
	print(y)


alpha = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
testCase = int(input())
for i in range(testCase):
	(n, a, b) = map(int, input().split())
	substring = ''
	for i in range(b):
		substring += alpha[i]
	repeat = n // b
	remain = n - len(substring) * repeat
	substring *= repeat
	for i in range(remain):
		substring += alpha[i]
	print(substring)


x = int(input())
for i in range(x):
	(n, a, b) = map(int, input().split())
	s = 'abcdefghijklmnopqrstuvwxyz'
	k = s[:b]
	t = n // b
	l = n % b
	p = k * t + k[:l]
	print(p)


def main():
	aplha = '#abcdefghijklmnopqrstuvwxyz'
	for _ in range(int(input())):
		nums = list(map(int, input().split()))
		word = []
		for i in range(int(nums[0] / nums[2])):
			word.append(aplha[1:nums[2] + 1])
		left = nums[0] - len(''.join(word))
		word.append(aplha[1:left + 1])
		print(''.join(word))
main()


for _ in range(int(input())):
	(l, m, n) = map(int, input().split())
	s = ''
	for i in range(n):
		s += chr(i + 97)
	a = ''
	j = 0
	for i in range(l):
		a += s[j]
		j = (j + 1) % n
	print(a)


import sys
input = lambda : sys.stdin.readline().rstrip()
t = int(input())
for i in range(t):
	(n, a, b) = map(int, input().split())
	r = []
	alpha = [chr(i) for i in range(ord('a'), ord('a') + b)]
	for i in range(n):
		r.append(alpha[i % len(alpha)])
	print(''.join(r))


x = int(input())
for i in range(x):
	(n, a, b) = list(map(int, input().split()))
	letras = 'abcdefghijklmnopqrstuvwxyz'
	saida = ''
	if a == 1 and b == 1:
		while len(saida) < n:
			if n - len(saida) >= 26:
				saida += letras
			else:
				saida += letras[0:n - len(saida)]
	else:
		while len(saida) < n:
			if n - len(saida) >= a:
				exato = int(a / b)
				resto = a % b
				for l in range(exato):
					saida += letras[0:b]
				saida += letras[0:resto]
			else:
				tamanho = n - len(saida)
				exato = int(tamanho / b)
				resto = tamanho % b
				for l in range(exato):
					saida += letras[0:b]
				saida += letras[0:resto]
	print(saida)


t = int(input())
alph = [chr(i) for i in range(97, 123)]
for tc in range(t):
	(n, a, b) = map(int, input().split())
	subs = []
	while len(subs) < a:
		for i in range(b):
			subs.append(alph[i])
			if len(subs) == a:
				break
	s = []
	while len(s) < n:
		for i in range(a):
			s.append(subs[i])
			if len(s) == n:
				break
	print(''.join(s))


t = int(input())
for _ in range(t):
	(n, a, b) = map(int, input().split())
	t = 'abcdefghijklmnopqrstuvwxyz'
	if a == b:
		print(t * (n // 26) + t[:n % 26])
	elif b == 1:
		print('a' * n)
	else:
		ans = t[:b] + (a - b) * t[b - 1]
		for i in range(n - a):
			ans += ans[i]
		print(ans)


for _ in range(int(input())):
	x = 'abcdefghijklmnopqrstuvwxyz'
	(n, a, b) = map(int, input().split())
	s = x[0:b]
	r = n // b + n % b
	ans = s * r
	print(ans[0:n])


import math
import sys
t = int(sys.stdin.readline())
for _ in range(t):
	(n, a, b) = map(int, sys.stdin.readline().split())
	s = 'a'
	for i in range(1, b):
		s += chr(ord('a') + i)
	n_times = math.ceil(n / b)
	s = s * n_times
	s = s[:n]
	print(s)


for lo in range(int(input())):
	(n, a, b) = map(int, input().split())
	ans = ''
	d = {}
	for i in range(97, 123):
		d[chr(i)] = 0
	st = ''
	diff = a - b + 1
	for i in range(diff):
		st += 'a'
	d['a'] = diff
	c = 98
	for i in range(b - 1):
		st += chr(c)
		d[chr(c)] = 1
		c += 1
	for i in range(a, n):
		s = st[i - a]
		st += s
	print(st)


for _ in range(int(input())):
	(n, a, b) = map(int, input().split())
	if a == b:
		t = 26
	else:
		t = b
	s = 'qwertyuioplkjhgfdsazxcvbnm'
	res = s[:t] * (n // t) + s[:n % t]
	print(res)


t = int(input())
s = 'abcdefghijklmnopqrstuvwxyz'
for i in range(t):
	num1 = list(map(int, input().split()))
	n = num1[0]
	a = num1[1]
	b = num1[2]
	z = s[:b]
	c = a % b
	d = a // b
	e = n % b
	f = n // b
	y = z * d + s[:c]
	x = z * f + s[:e]
	print(x)


x = int(input())
for i in range(x):
	(n, a, b) = list(map(int, input().split()))
	arr = ''
	for i in range(n):
		arr = arr + chr(i % b + 97)
	print(arr)


a = 'asdfghjklqwertyuiopzxcvbnm'
for i in range(int(input())):
	(x, y, z) = [int(i) for i in input().split()]
	b = x % z
	c = x // z
	print(a[0:z] * c, end='')
	print(a[0:b])


def res(n, a, b):
	abc = 'abcdefghijklmnopqrstuvwxyz'
	diff = abc[:b]
	temp1 = int(n / b + 1)
	ans = (diff * temp1)[:n]
	print(ans)
t = int(input())
for i in range(t):
	(n, a, b) = [int(x) for x in input().split()]
	res(n, a, b)


tc = int(input())
for _ in range(tc):
	(n, a, b) = map(int, input().split())
	base_list = [chr(97 + i) for i in range(b)]
	res = ''
	for i in base_list:
		res += i
	res = res * (int(n // b) + 1)
	print(res[:n])


T = int(input())
while T:
	(n, a, b) = map(int, input().split())
	k = 97
	c = ''
	for i in range(b):
		c = c + chr(k + i)
	S = c * n
	S = S[:n]
	print(S)
	T = T - 1


def main():
	for _ in range(int(input())):
		(n, a, b) = map(int, input().split())
		s = ''
		for i in range(b):
			s = s + chr(97 + i)
		k = s
		for i in range(n):
			for j in range(a):
				if len(s) <= a:
					s = s + s[j]
					k = k + s[j]
			if len(k) != n:
				s = s[1:]
		print(k[:n])
main()


t = int(input())
for t in range(t):
	(n, a, b) = input().split()
	(n, a, b) = (int(n), int(a), int(b))
	temp = []
	for i in range(97, 123):
		temp.append(chr(i))
	s = []
	for i in range(b):
		s.append(temp[i])
	for i in range(a - b):
		s.append(s[i])
	for i in range(n - a):
		s.append(s[i])
	for i in s:
		print(i, end='')
	print()


def compute(n, a, b):
	temp = ''
	stri = ''
	for i in range(b):
		temp += chr(97 + i % b)
	stri = temp * (n // b)
	return stri + temp[:n - len(stri)]
t = int(input())
for _ in range(t):
	(n, a, b) = map(int, input().split())
	print(compute(n, a, b))


num = int(input())
for i in range(num):
	l = list(map(int, input().split(' ')))
	l1 = []
	s = ''
	for i in range(l[2]):
		l1.append(97 + i)
	for i in range(l[0]):
		s += chr(l1[i % l[2]])
	print(s)


for _ in range(int(input())):
	(a, b, c) = map(int, input().split())
	d = ['a'] * a
	t = c - 1
	k = b - t
	r = 97
	e = []
	for j in range(c - 1):
		e.append(chr(r + 1))
		r += 1
	p = 0
	for i in range(a // b + 1):
		p = 0
		for j in range(b * (i + 1) - c + 1, min(b * (i + 1), a)):
			d[j] = e[p]
			p += 1
	print(''.join(d))


atoz = 'abcdefghijklmnopqrstuvwxyz'
for _ in range(int(input())):
	(a, b, c) = list(map(int, input().split()))
	print(atoz[:c] * (a // c) + atoz[:a % c])


from __future__ import division, print_function
import os, sys
from io import BytesIO, IOBase
if sys.version_info[0] < 3:
	from __builtin__ import xrange as range
	from future_builtins import ascii, filter, hex, map, oct, zip

def ii():
	return int(input())

def si():
	return input()

def mi():
	return map(int, input().strip().split(' '))

def msi():
	return map(str, input().strip().split(' '))

def li():
	return list(mi())

def dmain():
	sys.setrecursionlimit(100000000)
	threading.stack_size(40960000)
	thread = threading.Thread(target=main)
	thread.start()
abc = 'abcdefghijklmnopqrstuvwxyz'
abd = {'a': 0, 'b': 1, 'c': 2, 'd': 3, 'e': 4, 'f': 5, 'g': 6, 'h': 7, 'i': 8, 'j': 9, 'k': 10, 'l': 11, 'm': 12, 'n': 13, 'o': 14, 'p': 15, 'q': 16, 'r': 17, 's': 18, 't': 19, 'u': 20, 'v': 21, 'w': 22, 'x': 23, 'y': 24, 'z': 25}
mod = 1000000007
inf = float('inf')
vow = ['a', 'e', 'i', 'o', 'u']
(dx, dy) = ([-1, 1, 0, 0], [0, 0, 1, -1])

def getKey(item):
	return item[1]

def sort2(l):
	return sorted(l, key=getKey, reverse=True)

def d2(n, m, num):
	return [[num for x in range(m)] for y in range(n)]

def isPowerOfTwo(x):
	return x and (not x & x - 1)

def decimalToBinary(n):
	return bin(n).replace('0b', '')

def ntl(n):
	return [int(i) for i in str(n)]

def ncr(n, r):
	return factorial(n) // (factorial(r) * factorial(n - r))

def powerMod(x, y, p):
	res = 1
	x %= p
	while y > 0:
		if y & 1:
			res = res * x % p
		y = y >> 1
		x = x * x % p
	return res

def gcd(x, y):
	while y:
		(x, y) = (y, x % y)
	return x

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

def read():
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')

def main():
	for _ in range(ii()):
		(n, a, b) = mi()
		f = [0] * 26
		ans = ''
		for i in range(b):
			ans += abc[i]
			f[i] += 1
		for i in range(a - b):
			ans += abc[0]
			f[0] += 1
		for i in range(a, n):
			f[abd[ans[i - a]]] -= 1
			cnt = 0
			for j in range(26):
				if f[j] != 0:
					cnt += 1
			if cnt < b:
				rem = b - cnt
				for j in range(26):
					if f[j] == 0:
						ans += abc[j]
						rem -= 1
						f[j] += 1
					if rem == 0:
						break
			elif cnt == b:
				for j in range(26):
					if f[j] != 0:
						ans += abc[j]
						f[j] += 1
						break
		print(ans)
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')

def print(*args, **kwargs):
	(sep, file) = (kwargs.pop('sep', ' '), kwargs.pop('file', sys.stdout))
	at_start = True
	for x in args:
		if not at_start:
			file.write(sep)
		file.write(str(x))
		at_start = False
	file.write(kwargs.pop('end', '\n'))
	if kwargs.pop('flush', False):
		file.flush()
if sys.version_info[0] < 3:
	(sys.stdin, sys.stdout) = (FastIO(sys.stdin), FastIO(sys.stdout))
else:
	(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


s = 'abcdefghijklmnopqrstuvwxyz'
for i in range(int(input())):
	(n, a, b) = map(int, input().split())
	l = s[0:b]
	lz = int(n / b)
	ln = l * lz
	lst = ln + l[0:n - len(ln)]
	print(lst)


import sys
import os
import time
import collections
from collections import Counter, deque
import itertools
import math
import timeit
import random
import string

def sieve(n):
	if n < 2:
		return list()
	prime = [True for _ in range(n + 1)]
	p = 3
	while p * p <= n:
		if prime[p]:
			for i in range(p * 2, n + 1, p):
				prime[i] = False
		p += 2
	r = [2]
	for p in range(3, n + 1, 2):
		if prime[p]:
			r.append(p)
	return r

def divs(n, start=1):
	divisors = []
	for i in range(start, int(math.sqrt(n) + 1)):
		if n % i == 0:
			if n / i == i:
				divisors.append(i)
			else:
				divisors.extend([i, n // i])
	return divisors

def divn(n, primes):
	divs_number = 1
	for i in primes:
		if n == 1:
			return divs_number
		t = 1
		while n % i == 0:
			t += 1
			n //= i
		divs_number *= t

def flin(d, x, default=-1):
	left = right = -1
	for i in range(len(d)):
		if d[i] == x:
			if left == -1:
				left = i
			right = i
	if left == -1:
		return (default, default)
	else:
		return (left, right)

def ceil(n, k):
	return n // k + (n % k != 0)

def ii():
	return int(input())

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

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

def lcm(a, b):
	return abs(a * b) // math.gcd(a, b)

def prr(a, sep=' '):
	print(sep.join(map(str, a)))

def dd():
	return collections.defaultdict(int)

def ddl():
	return collections.defaultdict(list)
alph = string.ascii_lowercase
for _ in range(ii()):
	(n, a, b) = mi()
	t = alph[:b]
	res = t * ceil(n, b)
	print(res[:n])


T = int(input())
for cs in range(T):
	(n, a, b) = map(int, input().split())
	cli = []
	c = 'a'
	for i in range(a - b + 1):
		cli.append(c)
	for j in range(b - 1):
		c = chr(ord(c) + 1)
		cli.append(c)
	use = 0
	for i in range(n):
		print(cli[use], end='')
		use = (use + 1) % len(cli)
	print()


t = int(input())
s = 'abcdefghijklmnopqrstuvwxyz'
for ig in range(t):
	(n, a, b) = map(int, input().split())
	if a == b:
		ans = s[:n]
	else:
		ans = s[:b]
	ch = ans[-1]
	while len(ans) < a:
		ans += ch
	s1 = ans
	count = n // len(ans)
	while count > 1:
		ans += s1
		count -= 1
	count = n - len(ans)
	for i in range(count):
		ans += s1[i]
	print(ans)


def stg(a):
	s = 'a'
	for i in range(98, 98 + a - 1):
		s = s + chr(i)
	return s
for t in range(int(input())):
	(n, m, p) = map(int, input().split())
	sub = stg(p)
	str1 = ''
	k = int(n / p)
	x = n % p
	for i in range(1, k + 1):
		str1 += sub
	sub = sub[0:x]
	str1 += sub
	print(str1)


for i in range(int(input())):
	(a, b, c) = map(int, input().split())
	s = ''
	for i in range(c):
		s += chr(97 + i)
	k = 0
	st = ''
	for i in range(a):
		st += s[k]
		k += 1
		if k == len(s):
			k = 0
	print(st)


import string
from itertools import cycle
from sys import stdin

def main():
	input = lambda : stdin.readline()[:-1]
	ascii = string.ascii_lowercase
	T = int(input())
	for _ in [0] * T:
		(N, A, B) = map(int, input().split())
		ans = ''
		for s in cycle(ascii[:B]):
			ans += s
			N -= 1
			if N < 1:
				break
		print(ans)
main()


ins = int(input())
for _ in range(0, ins):
	(n, a, b) = map(int, input().split())
	alphabet = 'abcdefghijklmnopqrstuvwxyz'
	dist_let = alphabet[:b]
	d_ind = 0
	out_str = []
	for i in range(0, n):
		out_str.append(dist_let[d_ind])
		if d_ind == len(dist_let) - 1:
			d_ind = 0
		else:
			d_ind += 1
	print(''.join(out_str))


t = int(input())
s = 'qwertyuiopasdfghjklzxcvbnm'
for i in range(t):
	(n, a, b) = map(int, input().split())
	b = min(26, b)
	ss = ''
	q = s[:b] * (a // b) + s[:a % b]
	ss = q[:]
	for i in range(n - a):
		ss += q[i % b]
	print(ss)


for i in range(int(input())):
	(n, a, b) = map(int, input().split())
	s = 'abcdefghijklmnopqrstuvwxyz'
	res = s[0:b] * (n // b)
	c = n - len(res)
	print(res + s[0:c])


import sys
import heapq
import math

def input():
	return sys.stdin.readline().strip()

def iinput():
	return int(input())

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

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

def YES(flag):
	if flag:
		return 'YES'
	return 'NO'

def main():
	c = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
	(n, a, b) = rinput()
	res = list('a' * (a - b)) + [c[i] for i in range(b)]
	print(''.join(map(str, (res * ((n + a - 1) // a))[:n])))
for i in range(iinput()):
	main()


t = int(input())
alpha = [chr(ord('a') + i) for i in range(26)]
for _ in range(t):
	lst = list(map(int, input().split()))
	n = lst[0]
	a = lst[1]
	b = lst[2]
	ans = alpha[:b] * ((n + b - 1) // b)
	print(''.join(ans[:n]))


for i in range(int(input())):
	(n, a, b) = map(int, input().split())
	l = []
	for j in range(0, n):
		l.append(chr(97 + j % b))
	print(''.join(l))


import math
for i in range(int(input())):
	(n, a, b) = tuple(map(int, input().split()))
	s = 'abcdefghijklmnopqrstuvwxyz'
	s1 = s[:b]
	print(s1 * math.floor(n / b) + s1[:n % b])


T = int(input())
alph = 'abcdefghijklmnopqrstuvwxyz'
for x in range(T):
	(n, a, b) = map(int, input().split())
	req = ''
	for i in range(n):
		req += alph[i % b]
	print(req)


t = int(input())
while t:
	line = input().split()
	(n, a, b) = (int(line[0]), int(line[1]), int(line[2]))
	s = 'abcdefghijklmnopqrstuvwxyz'
	for i in range(n):
		print(s[i % b], end='')
	print()
	t -= 1


alphabet = 'abcdefghijklmnopqrstuvwxyz'
t = int(input())
for _ in range(t):
	(n, a, b) = map(int, input().split())
	temp = alphabet[:b]
	print(temp * divmod(n, b)[0] + temp[:divmod(n, b)[1]])


gg = 'abcdefghijklmnopqrstuvwxyz'
t = int(input())
while t:
	t -= 1
	(n, a, b) = map(int, input().split())
	b = min(a, b)
	r = a % b
	s = gg[:b] * (a // b) + gg[:r]
	ans = ''
	ans = s[:]
	for i in range(0, n - a):
		ans += s[i % b]
	print(ans)


import sys
input = sys.stdin.readline

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

def f():
	(n, a, b) = input_list()
	ai = ord('a')
	l = [chr(ai + i % b) for i in range(n)]
	print(''.join(l))

def main():
	t = int(input())
	for _ in range(t):
		f()
main()


for _ in range(int(input())):
	(n, a, b) = map(int, input().strip().split())
	s = ''
	x = 'abcdefghijklmnopqrstuvwxyz'
	s = x[:b] * (n // b)
	s += s[:n % b]
	print(s)


I = input
T = int(I())
for TT in range(T):
	(N, A, B) = I().split()
	n = int(N)
	a = int(A)
	b = int(B)
	s = 'abcdefghijklmnopqrstuvwxyz'
	while n >= b:
		n = n - b
		for i in range(b):
			print(s[i], end='')
	for i in range(n):
		print(s[i], end='')
	print()


def main():
	tc_count = int(input())
	for tc in range(tc_count):
		(n, a, b) = map(int, input().split())
		sol = []
		for i in range(b):
			sol.append(i)
		for i in range(b, a):
			sol.append(0)
		i = 0
		while len(sol) < n:
			sol.append(sol[i])
			i += 1
		print(''.join([chr(i + 97) for i in sol]))
main()


a = int(input())
for i in range(0, a):
	(n, dosent, b) = map(int, input().split())
	arr = []
	for i in range(0, b):
		arr.append(chr(97 + i))
	count = 0
	ans = ''
	i = 0
	while count < n:
		ans = ans + arr[i]
		i = i + 1
		if i >= len(arr):
			i = 0
		count = count + 1
	print(ans)


t = int(input())
x = 'abcdefghijklmnopqrstuvwxyz'
for _ in range(t):
	(n, a, b) = map(int, input().split())
	st = x[:b]
	if a > b:
		st = st + x[0] * (a - b)
	le = len(st)
	ans = st * (n // le) + st[:n % le]
	print(ans)


t = int(input())
while t:
	(n, a, b) = map(int, input().split())
	repeated = ''
	for i in range(b):
		repeated += chr(ord('a') + i)
	index = 0
	res = ''
	for i in range(n):
		res += repeated[index]
		index += 1
		if index == len(repeated):
			index = 0
	print(res)
	t -= 1


def main():
	T = int(input())
	for t in range(T):
		(n, a, b) = list(map(int, input().split()))
		s = [97 for i in range(n)]
		for i in range(b):
			s[i] += i
		for i in range(a, n):
			s[i] = s[i - a]
		for i in range(n):
			print(chr(s[i]), end='')
		print('')
main()


def solve(n, a, b):
	s = ''
	f = a // b
	for i in range(b):
		s += chr(97 + i) * f
	s = (s * 2)[:a]
	res = (s * (n // a + 1))[:n]
	return res
t = int(input())
for _ in range(t):
	(n, a, b) = map(int, input().split())
	print(solve(n, a, b))


for _ in range(int(input())):
	(n, a, b) = [int(i) for i in input().split()]
	s = ''
	j = 97
	for i in range(b):
		s += chr(j)
		j += 1
	k = a - b
	s = s + s[-1] * k
	k = int(n / a)
	s = s * k
	k = n % a
	s = s + s[0:k]
	print(s)


for _ in range(int(input())):
	(n, a, b) = map(int, input().split())
	let = 'abcdefghijklmnopqrstuvwxyz'
	s = let[:b]
	x = n - len(s)
	c = 0
	while x != n and c < x:
		s += s[c]
		c += 1
	print(s)


t = int(input())
for i in range(t):
	(n, a, b) = map(int, input().split(' '))
	z = ''
	y = 0
	for j in range(n):
		z += chr(y + 97)
		y += 1
		if y == b:
			y = 0
	print(z)


import string
alph = string.ascii_lowercase
t = int(input())
for _ in range(t):
	(n, a, b) = map(int, input().split())
	x = alph[:b] + (a - b) * alph[:b][-1]
	x = x * (n // len(x) + 1)
	print(x[:n])


chars = 'abcdefghijklmnopqrstuvwxyz'
n = int(input())
for i in range(n):
	x = input()
	x = x.split()
	p = int(x[0])
	q = int(x[1])
	r = int(x[2])
	if q > r:
		min = r
	else:
		min = q
	string = ''
	while len(string) < p:
		string += chars[:min]
	print(string[:p])


from math import ceil
from string import ascii_lowercase
for _ in range(int(input())):
	(n, a, b) = tuple(map(int, input().split()))
	no_of_parts = ceil(n / a)
	part = ascii_lowercase[:b]
	part += part[-1] * (a - b)
	res = part * no_of_parts
	print(res[:n])


t = int(input())
for i in range(t):
	(n, a, b) = map(int, input().split(' '))
	d = 'abcdefghijklmnopqrstuvwxyz'
	e = ''
	for j in range(0, n, b):
		if b < n - len(e):
			e = e + d[0:b]
		else:
			e = e + d[0:n - len(e)]
	print(e)


import collections
from math import ceil

def solve(n, a, b):
	string = []
	ch = 97
	for i in range(n):
		string.append(chr(ch))
		ch += 1
		if ch - 97 == b:
			ch = 97
	return ''.join(string[:n])
t = int(input().strip())
for i in range(t):
	[n, a, b] = list(map(int, input().strip().split()))
	print(solve(n, a, b))


t = int(input())
for ti in range(t):
	(n, a, b) = [int(i) for i in input().split(' ')]
	s = ''
	for i in range(b - 1):
		s += chr(97 + i)
	s += chr(97 + b - 1) * (a - b + 1)
	for i in range(n):
		print(s[i % len(s)], end='')
	print()


t = int(input())
for q in range(t):
	(n, a, b) = map(int, input().split())
	s = ''
	for i in range(b):
		s += chr(i + ord('a'))
	s *= 2001
	print(s[:n])


import sys
import string
input = sys.stdin.readline

def inp():
	return int(input())

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

def insr():
	s = input()
	return list(s[:len(s) - 1])

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

def bool_to_str(flag):
	if flag:
		return 'YES'
	else:
		return 'NO'
tests = inp()
alphabet = string.ascii_lowercase
for test in range(tests):
	(n, a, b) = inlt()
	out = ''
	b_buffer = 0
	for i in range(n):
		out += alphabet[b_buffer % a]
		b_buffer = (b_buffer + 1) % b
	print(out)


for i in range(int(input())):
	(n, a, b) = map(int, input().split())
	s = []
	cnt = b
	now = [0] * 26
	i = 0
	for i in range(b):
		s.append(chr(i + ord('a')))
		now[i] += 1
	now[0] += a - b
	s = ['a'] * (a - b) + s
	for i in range(a, n):
		now[ord(s[i - a]) - ord('a')] -= 1
		if now[ord(s[i - a]) - ord('a')] == 0:
			cnt -= 1
		if cnt == b:
			for j in range(26):
				if now[j] != 0:
					now[j] += 1
					s.append(chr(j + ord('a')))
					break
		else:
			for j in range(26):
				if now[j] == 0:
					now[j] += 1
					cnt += 1
					s.append(chr(j + ord('a')))
					break
	print(''.join(s))


t = int(input())
mas = 'abcdefghijklmnopqrstuvwxyz'
for i in range(t):
	(n, a, b) = map(int, input().split())
	s = ''
	while len(s) <= n:
		s += mas[:b]
	length = len(s)
	s = s[:n]
	print(s)


t = int(input())
alph = 'qwertyuiopasdfghjklzxcvbnm'
for i in range(t):
	(n, a, b) = map(int, input().split())
	ans = [''] * n
	for j in range(n):
		num = j % a
		ans[j] = alph[min(num, b - 1)]
	print(''.join(ans))


test_case = int(input())
my_list = []
alphabet = 'abcdefghijklmnopqrstuvwxyz'
for i in range(test_case):
	my_list.append([int(j) for j in input().split()])
for x in range(test_case):
	z = 0
	for y in range(my_list[x][0]):
		print(alphabet[z], end='')
		z += 1
		if my_list[x][2] == z:
			z = 0
	print()


char = [chr(i) for i in range(97, 123)]
arr = []
t = int(input())
for _ in range(t):
	(a, b, c) = map(int, input().split())
	s = ''
	for i in range(a):
		temp = i % c
		s += char[temp]
	arr.append(s)
for i in arr:
	print(i)


for Pythonic__Python in range(int(input())):
	s = 'abcdefghijklmnopqrstuvwxyz'
	(i, j) = (0, 0)
	(n, a, b) = map(int, input().split())
	ss = ''
	for k in range(n):
		if len(ss) < b:
			ss += s[i]
			i += 1
		else:
			ss += ss[j]
			j += 1
	print(ss)


import math
for i in range(int(input())):
	(m, a, b) = list(map(int, input().split()))
	n = a - b + 1
	x = 'qwertyuiopsdfghjklzxcvbnm'
	z = 'a' * n
	z += x[:a - n]
	n = len(z)
	i = 0
	while n < m:
		z += z[i]
		i += 1
		n += 1
	print(z)


t = int(input(''))
a = [[0] * 3 for _ in range(t)]
for i in range(t):
	a[i] = [int(j) for j in input().strip().split(' ')]
str = ''
max = 0
for i in range(t):
	for j in range(a[i][0]):
		max += 1
		str = str + chr(97 + max - 1)
		if max == a[i][2]:
			max = 0
	print(str)
	str = ''
	max = 0


letters = 'abcdefghijklmnopqrstuvwxyz'
for ii in range(int(input())):
	(n, a, b) = map(int, input().split())
	ans = ''
	offset = 0
	ptr = 1
	for i in range(0, n, a):
		temp = b
		ptr = 0
		while temp:
			ptr += 1
			ptr = ptr % 26
			ans += letters[ptr]
			temp -= 1
		ind = a - b
		for k in range(ind):
			ans += letters[ptr]
	print(ans[0:n])


import math
s = 'abcdefghijklmnopqrstuvwxyz'
x = int(input())
for _ in range(x):
	f = input().split()
	n = int(f[0])
	a = int(f[1])
	b = int(f[2])
	c = ''
	g = a - b + 1
	c += 'a' * g + s[1:b]
	h = len(c)
	t = c * (n // h) + c[:n % h]
	print(t)


t = int(input())
for _ in range(t):
	(n, a, b) = map(int, input().split())
	s = []
	for i in range(b):
		s.append(chr(i + 97))
	for i in range(a - b):
		s.append('a')
	s = s * (n // a)
	s = s + s[:n % a]
	print(*s, sep='')


for _ in range(int(input())):
	(n, a, b) = map(int, input().split())
	s = ''
	for i in range(b):
		y = i + 97
		y = chr(y)
		s += y
	q = n // b
	r = n % b
	ans = s * q + s[:r]
	print(ans)


t = int(input())
f = []
for _ in range(t):
	(n, a, b) = map(int, input().split())
	k = []
	for i in range(b):
		k.append(chr(97 + i))
	j = 0
	for i in range(n):
		if j == b:
			j = 0
		print(k[j], end='')
		j += 1
	print()


from math import *
t = int(input())
l = [chr(ord('a') + i) for i in range(26)]
for y in range(t):
	(n, a, b) = map(int, input().split())
	s = ''
	for i in range(n):
		s += l[i % b]
	print(s)


for _ in range(int(input())):
	(n, a, b) = map(int, input().split())
	val = 97 + b
	s = ''
	for i in range(97, val):
		s += chr(i)
	res = n // b
	rem = n % b
	ss = ''
	ss += s * res
	if rem != 0:
		ss += s[:rem]
	print(ss)


from random import choice

def compute(n, a, b):
	l = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
	s = ''
	(q, r) = (n // b, n % b)
	for i in range(b):
		m = choice(l)
		l.remove(m)
		s += m
	s = s * q
	m = s[:r]
	s += m
	return s
testcases = int(input())
for i in range(testcases):
	l = list(map(int, input().split()))
	print(compute(l[0], l[1], l[2]))


import string
d = dict(enumerate(string.ascii_lowercase, 1))
t = int(input())
for _ in range(t):
	(n, a, b) = list(map(int, input().split()))
	string = ''
	temp = 1
	loc = 1
	for i in range(n):
		if i % a != 0:
			if temp < 26 and loc < b:
				string += chr(ord('a') + temp % 26)
				temp += 1
				loc += 1
			else:
				string += chr(ord('a') + temp % 26)
		else:
			temp = 1
			loc = 1
			string += chr(ord('a') + temp % 26)
			if temp < 26 and loc < b:
				temp += 1
				loc += 1
	print(string)


for _ in range(int(input())):
	(n, a, b) = map(int, input().split())
	s = ''
	c = 1
	k = 0
	x = 0
	for i in range(n):
		if i < b:
			s += chr(x % 26 + ord('a'))
			if i == b - 1:
				k = chr(x % 26 + ord('a'))
			x += 1
		elif i < a:
			s += k
			c += 1
		else:
			if s[i - a] == k:
				s += k
			else:
				s += chr(x % 26 + ord('a'))
				x += 1
			if chr(x % 26 + ord('a')) == k:
				x += 1
	print(s)


t = int(input())

def toChar(a):
	return chr(a + ord('a'))
for i in range(t):
	(n, a, b) = map(int, input().split())
	pattern = list(map(toChar, range(b)))
	index = b
	while index < a:
		pattern.append(pattern[index - 1])
		index += 1
	index = 0
	while index < n:
		print(pattern[index % b], end='')
		index += 1
	print('')


MOD = 10 ** 9 + 7

def main():
	test = int(input())
	l = 'abcdefghijklmnopqrstuvwxyz'
	for iteration in range(test):
		(n, a, b) = [int(i) for i in input().split()]
		str = l[:b]
		times = n // len(str)
		ans = str * (times + 1)
		print(ans[:n])
main()


t = int(input())
for i in range(t):
	(n, a, b) = map(int, input().split())
	c = [97]
	while b > 1:
		c.append(c[-1] + 1)
		b -= 1
	if a > b:
		j = 0
		while len(c) < n:
			c.append(c[j])
			j += 1
	elif a == b == 1:
		c = [97] * n
	elif a == b:
		while len(c) < n:
			c.append(c[-1] + 1)
	print(''.join(list(map(chr, c))))


t = int(input())
for _ in range(0, t):
	(n, a, b) = input().split()
	n = int(n)
	a = int(a)
	b = int(b)
	i = 0
	x = 97
	z = []
	ans = ''
	while i < a:
		if a - i % a < b:
			if len(z) == 0:
				z.append(chr(x))
			else:
				x = x + 1
				z.append(chr(x))
			i = i + 1
		else:
			z.append(chr(x))
			i = i + 1
	for i in range(0, n):
		ans = ans + z[i % a]
	print(ans)


for i in range(int(input())):
	arr = list('abcdefghijklmnopqrstuvwxyz')
	(n, a, b) = map(int, input().split())
	litter = [arr[i] for i in range(b)]
	full = ''
	i = 0
	while n != 0:
		if i == b:
			i = 0
		full = full + litter[i]
		i = i + 1
		n = n - 1
	print(full)


import sys
t = int(sys.stdin.readline())
alpha = 'abcdefghijklmnopqrstuvwxyz'
for _ in range(t):
	(n, a, b) = map(int, sys.stdin.readline().split())
	word = ''
	while len(word) <= n:
		word += alpha[:b]
	word = word[0:n]
	print(word)


import sys
import math
from collections import Counter
input = sys.stdin.readline
from functools import lru_cache
import bisect

def solve():
	(n, a, b) = map(int, input().split(' '))
	base = ''
	curr = [chr(c) for c in range(ord('a'), ord('z') + 1)]
	for i in range(b):
		base += curr[i]
	for i in range(a - b):
		base += base[-1]
	for i in range(a + 1, n + 1):
		base += base[i - 1 - a]
	print(base)
t = int(input())
for _ in range(t):
	solve()


import math as mt
dic = [chr(i) for i in range(97, 123)]
for _ in range(int(input())):
	(n, a, b) = [int(j) for j in input().split()]
	l = []
	i = 0
	x = a - b
	y = b
	while n > 0:
		l.append(dic[i])
		i = i + 1
		y = y - 1
		n = n - 1
		if y == 0:
			i = i - 1
			while x != 0 and n != 0:
				l.append(dic[i])
				x = x - 1
				n = n - 1
			i = 0
			y = b
			x = a - b
	print(''.join(l))


import sys
t = int(input())
for _ in range(t):
	(n, a, b) = [int(c) for c in input().split()]
	prefix = 'abcdefghijklmnopqrstuvwxyz'[:b]
	suffix = 'a' * (a - b)
	s = prefix + suffix
	res = s
	while len(res) < n:
		res += s
	res = res[:n]
	print(res)


w = 'abcdefghijklmnopqrstuvwxyz'
for _ in range(int(input())):
	(n, a, b) = map(int, input().split())
	ans = w[0:b]
	i = 0
	for j in range(0, n):
		print(w[i % b], end='')
		i += 1
	print()


exec(int(input()) * "n,a,b=map(int,input().split());print(''.join(chr(97+i%b)for i in range(n)));")


t = int(input())
for _ in range(t):
	(n, a, b) = list(map(int, input().split()))
	s = 'abcdefghijklmnopqrstuvwxyz'
	res = s[:b]
	mod = n % b
	res = res * (n // b)
	res = res + s[:mod]
	print(res)


import sys
import math
from statistics import mean
input = sys.stdin.readline

def inp():
	return int(input())

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

def insr():
	s = input()
	return list(s[:len(s) - 1])

def invr():
	return map(int, input().split())
t = inp()
res = 'abcdefghijklmnopqrstuvwxyz'
for i in range(t):
	(n, a, b) = invr()
	r = res[0:b]
	x = math.ceil(n / b)
	s = ''
	s = s + r * x
	s = s[0:n]
	print(s, end='\n')


t = int(input())
answ = []
sl = 'abcdefghijklmnopqrstuvwxyz'
for i in range(t):
	inpt = input()
	inpt = inpt.split(' ')
	(n, a, b) = inpt
	n = int(n)
	a = int(a)
	b = int(b)
	k = 0
	s = ''
	while k < n:
		s = s + sl[:b]
		k = k + b
	answ.append(s[0:n])
for i in answ:
	print(i)


for _ in range(int(input())):
	(n, a, b) = map(int, input().split())
	word = list(' ' * n)
	alph = 'abcdefghijklmnopqrstuvwxyz'
	for i in range(n):
		j = 0
		if i - a < 0:
			ind_1 = 0
		else:
			ind_1 = i - a + 1
		n_unique = len(set(word[ind_1:i]) - {' '})
		if n_unique <= b - 1:
			while alph[j] in set(word[ind_1:i]):
				j += 1
				j %= 26
		word[i] = alph[j]
	print(''.join(word))


for x in range(int(input())):
	(n, a, b) = [int(i) for i in input().split()]
	s = ''
	al = 'qwertyuiopasdfghjklzxcvbnm'
	cur = al[:b]
	s += cur * int(n / b)
	s += al[:n % b]
	print(s)


t = int(input())
while t:
	(n, a, b) = map(int, input().split())
	x = ord('a')
	init = ''
	for i in range(0, b):
		init = init + chr(x + i)
	while len(init) < n:
		init = init + init
	print(init[0:n])
	t = t - 1


import string
alphabet_string = string.ascii_lowercase
t = int(input())
for _ in range(t):
	(n, a, b) = list(map(int, input().split(' ')))
	s = alphabet_string[:b]
	s1 = alphabet_string[:n % b]
	print(s * (n // b) + s1)


al = 'azertyuiopqsdfghjklmwxcvbn'
for _ in range(int(input())):
	(n, a, b) = list(map(int, input().split()))
	s = al[:b] * (n // b) + al[:n % b]
	print(s)


def solve():
	(n, a, b) = map(int, input().split())
	s = ''
	for i in range(97, 97 + b):
		s += chr(i)
	res = ''
	res += s * (n // b)
	rem = n % b
	if rem != 0:
		res += s[:rem]
	print(res)
t = int(input())
for loop in range(t):
	solve()


t = int(input())
for test in range(t):
	(n, a, b) = map(int, input().split())
	p = []
	x = 97
	for i in range(b):
		p.append(chr(x))
		x += 1
	ans = ''.join(p)
	q = n // b
	s = ''
	for i in range(q):
		s += ans
	y = 0
	while len(s) != n:
		s += p[y]
		y += 1
	print(s)


import sys
input = sys.stdin.readline

def main():
	t = int(input())
	for _ in range(t):
		(N, A, B) = [int(x) for x in input().split()]
		subs = []
		for i in range(B):
			subs.append(chr(ord('a') + i))
		print(''.join(subs) * (N // B), end='')
		for i in range(N % B):
			print(subs[i], end='')
		print()
main()


for _ in range(int(input())):
	(n, a, b) = [int(x) for x in input().split()]
	s = ''
	for i in range(0, n):
		s += chr(97 + i % b)
	print(s)


pp = 'abcdefghijklmnopqrstuvwxyz'
t = int(input())
s = []
for hhh in range(0, t):
	(n, a, b) = map(int, input().split())
	f = ''
	for i in range(1, n + 1):
		f += pp[i % b]
	s.append(f)
for i in s:
	print(i)


def solve(n, a, b):
	d = n // b
	r = n % b
	s = ''
	res = ''
	for i in range(ord('a'), ord('a') + b):
		s = s + chr(i)
	res = s * d
	if r == 0:
		print(res)
	else:
		for j in range(ord('a'), ord('a') + r):
			res += chr(j)
		print(res)
t = int(input())
while t != 0:
	(n1, a1, b1) = map(int, input().split(' '))
	solve(n1, a1, b1)
	t -= 1


t = int(input())
while t:
	(n, a, b) = list(map(int, input().split()))
	abcd = [chr(i) for i in range(ord('a'), ord('z') + 1)]
	s = ''
	count = 0
	for i in range(n):
		s += abcd[count]
		count += 1
		if count >= b:
			count = 0
	print(s)
	t -= 1


t = int(input())
while t > 0:
	(n, a, b) = (int(i) for i in input().split())
	tt = ''
	for i in range(n):
		tt += chr(ord('a') + i % b)
	print(tt)
	t -= 1