#include <bits/stdc++.h>
#pragma GCC optimize(2)
#pragma GCC optimize(3)
using namespace std;
inline int read() {
  int x = 0, neg = 1;
  char op = getchar();
  while (!isdigit(op)) {
    if (op == '-') neg = -1;
    op = getchar();
  }
  while (isdigit(op)) {
    x = 10 * x + op - '0';
    op = getchar();
  }
  return neg * x;
}
inline void print(int x) {
  if (x < 0) {
    putchar('-');
    x = -x;
  }
  if (x >= 10) print(x / 10);
  putchar(x % 10 + '0');
}
char ans[2005];
int n, a, b;
int main() {
  int T = read();
  while (T--) {
    n = read(), a = read(), b = read();
    for (int i = a, j = 0; i >= 1; i--, j++) {
      if (j < b)
        ans[i] = char(j + 'a');
      else
        ans[i] = ans[i + 1];
    }
    for (int i = a + 1; i <= n; i++) {
      int buc[26] = {0};
      for (int j = i - a + 1; j < i; j++) {
        buc[ans[j] - 'a'] = 1;
      }
      int pp = 0;
      for (int j = 0; j < 26; j++) {
        if (buc[j]) pp++;
      }
      if (pp == b) {
        ans[i] = ans[i - 1];
      } else {
        for (int j = 0; j < 26; j++) {
          if (!buc[j]) {
            ans[i] = char(j + 'a');
            break;
          }
        }
      }
    }
    for (int i = 1; i <= n; i++) {
      printf("%c", ans[i]);
    }
    puts("");
  }
  return 0;
}
