#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b, n;
  int T;
  char c[2020];
  scanf("%d", &T);
  while (T--) {
    scanf("%d %d %d", &n, &a, &b);
    memset(c, 0, sizeof(c));
    int number = 0;
    if (a == b) {
      char ch = 'a';
      for (int i = 1; i <= n; i++) {
        printf("%c", ch);
        ch = ch + 1;
        if (ch > 'z') ch = ch - 'z' - 1 + 'a';
      }
      printf("\n");
      continue;
    }
    int i, j;
    for (i = 0; i < b; i++) c[i] = i + int('a');
    for (j = b; j < 2 * b; j++) c[j] = c[2 * b - j - 1];
    for (i = 2 * b; i < a / b * b + b; i++) c[i] = c[i % (2 * b)];
    while (number < n) {
      printf("%c", c[number % a]);
      number++;
    }
    printf("\n");
  }
  return 0;
}
