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.

Difficulty: EASY

Solutions:
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)


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])


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))


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()


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()


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()


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]))


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])


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


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)


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())
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)


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()


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])


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])


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))


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)


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)


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='')


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)


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)


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


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))


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))


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))


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, 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)


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)


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())
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)


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)


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)


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)


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())
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)


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


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])


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


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)


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])


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])


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)


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)


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)


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])


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)


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)


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)


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


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)


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 __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)


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()


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)


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()


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))


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])


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)


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()


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()


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)


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))


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())
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)


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)


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()


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)


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)


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])


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)


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)


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()


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)


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 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)


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)


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 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()


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)


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)


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()


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)


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))


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())
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)


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)


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)


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)


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())
	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())
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])


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))


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()


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)


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 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()


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])


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='')


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)


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())
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)


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()


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))


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


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)


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))


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)


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())
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)


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])


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)


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()


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)


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)])


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 i in range(t):
	(n, a, b) = map(int, input().split())
	alphabet = 'abcdefghijklmnopqrstuvwxyz'
	sv = alphabet[0:b]
	sv = sv * n
	print(sv[0:n])


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)


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 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 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])


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)


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)


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()


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)


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


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('')


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()


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)


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()


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])


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)


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))


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)


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='')


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())
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)


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
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)


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)


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)


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])


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)


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])


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)


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)


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())
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()


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)


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()


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)


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)


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)


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)))


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()


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])


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)


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()


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 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)


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)


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')


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))


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))


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) = list(map(int, input().split()))
	for i in range(N):
		print(chr(ord('a') + i % b), end='')
	print()


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)


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)


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)


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)


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)


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)


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])


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('')


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)])


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)


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 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)


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))


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)


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)


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)


import string
for i in range(int(input())):
	(n, a, b) = map(int, input().split())
	res = string.ascii_lowercase[:b] * n
	print(res[:n])


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)


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)


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 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 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)


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))


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)


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) = 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)


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)


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)


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


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()


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)


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()


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())
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)


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)


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])


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])


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())
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)


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))


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)


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())
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


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)


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()


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)


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()


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])


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)


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()


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()


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)


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)


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()


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()


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])


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)


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))


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])


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)


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


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()


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])


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)


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


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()


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)


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)


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)


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)


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)


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)


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


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)


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)


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()


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 = 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


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)


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())
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)


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))


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()


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)


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())
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)


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)


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))


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)


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='')


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)


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)


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)


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))))


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)


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)


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()


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)


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)


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


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])


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]}')


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)


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)


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()


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()


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))


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])


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])


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)


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()


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])


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)


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 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()


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()


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)


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='')


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))


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()


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)


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


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)])


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)


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])


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)


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()


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])


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)


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()


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())
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))


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):
	(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)


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)


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])


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)


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)


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)


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='')


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)


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())
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())
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 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()


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 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)])


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)


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)


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])


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))


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 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))


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)


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)


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)


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='')


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])


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])


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)


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()


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()


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


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])


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)


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])


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


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())
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


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)


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))


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()


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()


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)


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)


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


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)


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 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('')


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()


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()


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)


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)


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)


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)


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))


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))


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 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)


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()


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)


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])


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))


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))


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()


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])


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()


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))


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())
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 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))


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)


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)


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 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)


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


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])


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))


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])


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]])


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()


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())
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


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)


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())
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)


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)


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


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)


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()


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)


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)


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)


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)


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