#include <bits/stdc++.h>
using namespace std;
int t, n, a, b, str[2002], md[27][2002], l;
void clr() {
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= 26; j++) md[j][i] = 0;
    str[i] = 0;
  }
}
void fil(int x) {
  for (int i = 1; i <= l; i++) {
    md[i][x] = md[i][x - 1];
  }
}
int ret(int x) {
  int d = 0;
  int m = 0;
  for (int i = 1; i <= l; i++) {
    if (md[i][x - 1] - md[i][x - a] > 0)
      d++;
    else
      m = i;
  }
  fil(x);
  if (d == b) {
    md[str[x - 1]][x]++;
    return str[x - 1];
  } else {
    md[m][x]++;
    return m;
  }
}
int main() {
  scanf("%d\n", &t);
  while (t--) {
    scanf("%d%d%d\n", &n, &a, &b);
    clr();
    l = min(26, b);
    int mx = a;
    for (int i = 1; i <= b; i++) {
      fil(i);
      md[i][i]++;
      str[i] = i;
    }
    for (int i = b + 1; i <= a; i++) fil(i), md[b][i]++, str[i] = b;
    for (int i = a + 1; i <= n; i++) str[i] = ret(i);
    for (int i = 1; i <= n; i++) printf("%c", (char)(str[i] + 96));
    printf("\n");
  }
}
